https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104746
Andrew Macleod <amacleod at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |amacleod at redhat dot com
--- Comment #7 from Andrew Macleod <amacleod at redhat dot com> ---
(In reply to Martin Sebor from comment #6)
> None of these "false positives" is due to a bug in the warning code. The
> warning has been designed and documented to work this way. What triggers
> more instances of these warnings in GCC 12 is the more accurate range info
> courtesy of Ranger. Prior to GCC 12, the ranges were less accurate and
> sometimes unavailable at all, and the warning is designed to avoid
> triggering in the absence of any range info at all.
>
> So I don't consider this a regression.
"Regression" is defined as didn't cause a problem before, but does now. Making
this a regression.
Besides, according to the warning:
size 4 [-Wformat-overflow=]
8 | __builtin_sprintf (a, "%u%u", i, j);
| ^~
b.c:8:25: note: using the range [0, 4294967295] for directive argument
8 | __builtin_sprintf (a, "%u%u", i, j);
| ^~~~~~
b.c:8:25: note: using the range [0, 4294967295] for directive argument
b.c:8:3: note: ‘__builtin_sprintf’ output between 3 and 21 bytes into a
destination of size 4
8 | __builtin_sprintf (a, "%u%u", i, j);
its using [0, 4294967295] as the range, which is [0, 0xFFFFFFFF] or varying..
so there isn't any new precision of ranges from ranger causing this? TVRYING
implies there is no range at all known.
Wouldnt we be seeing [0,9] if you were getting more precise ranges?