]> git.ipfire.org Git - thirdparty/glibc.git/commit - csu/libc-start.c
Disable spurious -Wstringop-overflow for setjmp/longjmp (bug 26647)
authorJoseph Myers <joseph@codesourcery.com>
Fri, 30 Oct 2020 21:38:31 +0000 (21:38 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Fri, 30 Oct 2020 21:38:31 +0000 (21:38 +0000)
commit2098d4034d398cbde6ccd4a2aaac52c518374698
tree084187792f130c01300200927c0b3307967547b6
parent961d12d9471f0178441e67e073ba2f3085cf20f1
Disable spurious -Wstringop-overflow for setjmp/longjmp (bug 26647)

Building glibc with GCC 11 fails with (among other warnings) spurious
-Wstringop-overflow warnings from calls to setjmp and longjmp with a
pointer to a pthread_unwind_buf that is smaller than jmp_buf.  As
discussed in bug 26647, the warning in libc-start.c is a false
positive, because setjmp and longjmp do not access anything (the
signal mask) beyond the common prefix of the two structures, so this
patch disables the warning for that call to setjmp, as well as for two
calls in NPTL code that produce the same warning and look like false
positives for the same reason.

Tested with build-many-glibcs.py for arm-linux-gnueabi, where this
allows the build to get further.

Reviewed-by: DJ Delorie <dj@redhat.com>
csu/libc-start.c
nptl/pthread_create.c
nptl/unwind.c