[PATCH] avoid -Wrestrict on sprintf %p with destination as argument (PR 84919)
Martin Sebor
msebor@gmail.com
Wed Jan 22 15:39:00 GMT 2020
The early front-end only implementation of -Wrestrict that's still
present in GCC 10 issues a false postive for %p arguments that are
the same as the destination. Bug 84919 reports an instance of this
false positive in the Linux kernel.
That attached patch suppresses the front-end warning for the sprintf
family of functions, letting the sprintf pass that was in GCC 10
extended to also handle -Wrestrict for these functions, handle
them instead.
Tested on x86_64-linux.
Since this is a regression I'd like to commit the fix to GCC 10.
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-84919.diff
Type: text/x-patch
Size: 2483 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20200122/f3dd4a59/attachment.bin>
More information about the Gcc-patches
mailing list