This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/79082] -Wformat-truncation inconsistent behaviour
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 19 Jan 2017 19:56:03 +0000
- Subject: [Bug c/79082] -Wformat-truncation inconsistent behaviour
- Auto-submitted: auto-generated
- References: <bug-79082-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79082
--- Comment #5 from Martin Sebor <msebor at gcc dot gnu.org> ---
I see no warning at -O0 on
snprintf (buffer, 4, "%03hx", val & 0xfff);
or at -O2 on:
snprintf (buffer, 3, "%2d", (val < 0) ? -(val % 100) : val % 100);
(It does warn at -O0 as expected.) This is on x86_64 (both ILP32 and LP64) but
there are known issues in VRP that have been seen to lead to false positives.
What target are you seeing false positives on and with what revision?