mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-21 20:40:05 +00:00
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.
This commit is contained in:
parent
cfdc4df66c
commit
5e89ed42fd
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user