mirror of git://sourceware.org/git/glibc.git
realloc_check has
unsigned char *magic_p;
...
__libc_lock_lock (main_arena.mutex);
const mchunkptr oldp = mem2chunk_check (oldmem, &magic_p);
__libc_lock_unlock (main_arena.mutex);
if (!oldp)
malloc_printerr ("realloc(): invalid pointer");
...
if (newmem == NULL)
*magic_p ^= 0xFF;
with
static void malloc_printerr(const char *str) __attribute__ ((noreturn));
GCC 7 -O3 warns
hooks.c: In function ‘realloc_check’:
hooks.c:352:14: error: ‘magic_p’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
*magic_p ^= 0xFF;
due to the GCC bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82090
This patch silences GCC 7 by using DIAG_IGNORE_NEEDS_COMMENT.
[BZ #22052]
* malloc/hooks.c (realloc_check): Use DIAG_IGNORE_NEEDS_COMMENT
to silence -O3 -Wall warning with GCC 7.
|
||
|---|---|---|
| .. | ||
| Depend | ||
| Makefile | ||
| Versions | ||
| alloc_buffer_alloc_array.c | ||
| alloc_buffer_allocate.c | ||
| alloc_buffer_copy_bytes.c | ||
| alloc_buffer_copy_string.c | ||
| alloc_buffer_create_failure.c | ||
| arena.c | ||
| dynarray-skeleton.c | ||
| dynarray.h | ||
| dynarray_at_failure.c | ||
| dynarray_emplace_enlarge.c | ||
| dynarray_finalize.c | ||
| dynarray_resize.c | ||
| dynarray_resize_clear.c | ||
| hooks.c | ||
| malloc-hooks.h | ||
| malloc-internal.h | ||
| malloc.c | ||
| malloc.h | ||
| mallocbug.c | ||
| mcheck-init.c | ||
| mcheck.c | ||
| mcheck.h | ||
| memusage.c | ||
| memusage.sh | ||
| memusagestat.c | ||
| morecore.c | ||
| mtrace.c | ||
| mtrace.pl | ||
| obstack.c | ||
| obstack.h | ||
| reallocarray.c | ||
| scratch_buffer_grow.c | ||
| scratch_buffer_grow_preserve.c | ||
| scratch_buffer_set_array_size.c | ||
| set-freeres.c | ||
| thread-freeres.c | ||
| tst-alloc_buffer.c | ||
| tst-calloc.c | ||
| tst-dynarray-at-fail.c | ||
| tst-dynarray-fail.c | ||
| tst-dynarray-shared.h | ||
| tst-dynarray.c | ||
| tst-interpose-aux-nothread.c | ||
| tst-interpose-aux-thread.c | ||
| tst-interpose-aux.c | ||
| tst-interpose-aux.h | ||
| tst-interpose-nothread.c | ||
| tst-interpose-skeleton.c | ||
| tst-interpose-static-nothread.c | ||
| tst-interpose-static-thread.c | ||
| tst-interpose-thread.c | ||
| tst-malloc-backtrace.c | ||
| tst-malloc-fork-deadlock.c | ||
| tst-malloc-tcache-leak.c | ||
| tst-malloc-thread-exit.c | ||
| tst-malloc-thread-fail.c | ||
| tst-malloc-usable-static-tunables.c | ||
| tst-malloc-usable-static.c | ||
| tst-malloc-usable-tunables.c | ||
| tst-malloc-usable.c | ||
| tst-malloc.c | ||
| tst-mallocfork.c | ||
| tst-mallocfork2.c | ||
| tst-mallocstate.c | ||
| tst-mallopt.c | ||
| tst-mcheck.c | ||
| tst-memalign.c | ||
| tst-mtrace.c | ||
| tst-mtrace.sh | ||
| tst-obstack.c | ||
| tst-posix_memalign.c | ||
| tst-pvalloc.c | ||
| tst-realloc.c | ||
| tst-reallocarray.c | ||
| tst-scratch_buffer.c | ||
| tst-trim1.c | ||
| tst-valloc.c | ||