https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88835
Bug ID: 88835 Summary: [9 Regression] Maybe misleading -Werror=format-overflow since r265648 Product: gcc Version: 9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: marxin at gcc dot gnu.org CC: msebor at gcc dot gnu.org Target Milestone: --- Host: i586-linux-gnu Created attachment 45424 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45424&action=edit test-case I originally reported that to elfutils bugzilla. The warning looks as follows: $ gcc -m32 /tmp/readelf.i -c -O2 -Werror=format-overflow readelf.c: In function ‘print_debug_str_section’: readelf.c:10152:15: error: ‘%*llx’ directive output between 4 and 2147483647 bytes may cause result to exceed ‘INT_MAX’ [-Werror=format-overflow=] 10152 | printf (" [%*" PRIx64 "] \"%s\"\n", digits, (uint64_t) offset, str); | ^~~~~~ readelf.c:10152:15: note: directive argument in the range [0, 18446744073709551614]