https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95496
Bug ID: 95496 Summary: [10/11 Regression] Bogus -Wformat-overflow= warnings with -fsanitize=undefined Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: sanitizer Assignee: unassigned at gcc dot gnu.org Reporter: hjl.tools at gmail dot com CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org, jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at gcc dot gnu.org Target Milestone: --- Created attachment 48666 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48666&action=edit A testcase GCC 10.1 gave [hjl@gnu-cfl-2 tmp]$ gcc -Wall -S -O2 x.i -fsanitize=undefined In function ‘pe_print_idata’, inlined from ‘_bfd_pe_print_private_bfd_data_common’ at peXXigen.c:2979:3: peXXigen.c:1378:3: warning: null format string [-Wformat-overflow=] peXXigen.c:1378:3: warning: null format string [-Wformat-overflow=] In function ‘pe_print_edata’, inlined from ‘_bfd_pe_print_private_bfd_data_common’ at peXXigen.c:2980:3: peXXigen.c:1713:3: warning: null format string [-Wformat-overflow=] peXXigen.c:1719:3: warning: null format string [-Wformat-overflow=] peXXigen.c:1716:3: warning: null format string [-Wformat-overflow=] peXXigen.c:1719:3: warning: null format string [-Wformat-overflow=] peXXigen.c:1719:3: warning: null format string [-Wformat-overflow=] peXXigen.c:1737:3: warning: null format string [-Wformat-overflow=] peXXigen.c:1744:3: warning: null format string [-Wformat-overflow=] peXXigen.c:1740:3: warning: null format string [-Wformat-overflow=] peXXigen.c:1744:3: warning: null format string [-Wformat-overflow=] peXXigen.c:1744:3: warning: null format string [-Wformat-overflow=] peXXigen.c:1747:3: warning: null format string [-Wformat-overflow=] peXXigen.c:1750:3: warning: null format string [-Wformat-overflow=] peXXigen.c:1750:3: warning: null format string [-Wformat-overflow=] peXXigen.c:1755:3: warning: null format string [-Wformat-overflow=] peXXigen.c:1760:3: warning: null format string [-Wformat-overflow=] peXXigen.c:1760:3: warning: null format string [-Wformat-overflow=] peXXigen.c:1760:3: warning: null format string [-Wformat-overflow=] [hjl@gnu-cfl-2 tmp]$ GCC 9.3 is OK.