!461 enable -werror by default

From: @liqingqing_1229 
Reviewed-by: @yang_yanchao 
Signed-off-by: @yang_yanchao
This commit is contained in:
openeuler-ci-bot 2022-07-06 07:52:08 +00:00 committed by Gitee
commit 487ba8e9b4
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 42 additions and 2 deletions

View File

@ -0,0 +1,36 @@
From 5e89ed42fd8997414732525c9460878d65363b3f Mon Sep 17 00:00:00 2001
From: Yang Yanchao <yangyanchao6@huawei.com>
Date: Fri, 15 Apr 2022 17:25:05 +0800
Subject: [PATCH] elf: Fix compile error with -Werror and -DNDEBUG
Using -Werror and -DNDEBUG at the same time will trigger the
following compiler error:
cache.c: In function 'save_cache':
cache.c:758:15: error: unused variable 'old_offset' [-Werror=unused-variable]
758 | off64_t old_offset = lseek64 (fd, extension_offset, SEEK_SET);
| ^~~~~~~~~~
-DNDEBUG disables the assertion, making old_offset unused.
Use __attribute__ ((unused)) to disable this warning.
---
elf/cache.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/elf/cache.c b/elf/cache.c
index abe2e49..3d7d3a6 100644
--- a/elf/cache.c
+++ b/elf/cache.c
@@ -727,7 +727,8 @@ save_cache (const char *cache_name)
if (opt_format != opt_format_old)
{
/* Align file position to 4. */
- off64_t old_offset = lseek64 (fd, extension_offset, SEEK_SET);
+ __attribute__ ((unused)) off64_t old_offset
+ = lseek64 (fd, extension_offset, SEEK_SET);
assert ((unsigned long long int) (extension_offset - old_offset) < 4);
write_extensions (fd, str_offset, extension_offset);
}
--
1.8.3.1

View File

@ -30,7 +30,7 @@
%bcond_without testsuite
%bcond_with benchtests
%bcond_with bootstrap
%bcond_with werror
%bcond_without werror
%bcond_without docs
%ifarch x86_64 aarch64
%bcond_without compat_2_17
@ -66,7 +66,7 @@
##############################################################################
Name: glibc
Version: 2.34
Release: 89
Release: 90
Summary: The GNU libc libraries
License: %{all_license}
URL: http://www.gnu.org/software/glibc/
@ -225,6 +225,7 @@ Patch137: realpath-Avoid-overwriting-preexisting-error-CVE-2021-3998.patch
Patch138: Linux-Avoid-closing-1-on-failure-in-__closefrom_fall.patch
Patch139: Fix-deadlock-when-pthread_atfork-handler-calls-pthre.patch
Patch140: linux-Fix-mq_timereceive-check-for-32-bit-fallback-c.patch
Patch141: elf-Fix-compile-error-with-Werror-and-DNDEBUG.patch
Patch9000: turn-default-value-of-x86_rep_stosb_threshold_form_2K_to_1M.patch
Patch9001: delete-no-hard-link-to-avoid-all_language-package-to.patch
@ -1400,6 +1401,9 @@ fi
%endif
%changelog
* Wed Jul 6 2022 Qingqing Li <liqingqing3@huawei.com> - 2.34-90
- enable -werror by default
* Fri Jul 1 2022 Qingqing Li <liqingqing3@huawei.com> - 2.34-89
- Fix mq_timereceive check for 32 bit fallback code (BZ 29304)