On 01/31/2017 03:42 PM, Jakub Jelinek wrote:
On Tue, Jan 31, 2017 at 03:33:04PM -0700, Jeff Law wrote:
My general inclination is to ask this to wait for gcc-8 as it is not a
regression, but instead a false positive in a new warning.
Well, as the warning is enabled by -Wall, the false positives in it are
regressions (while false negatives are not, as it is a new warning).
I wouldn't necessarily call that a regression though. But I see your point.
However, if we see this triggering with any significant frequency, then we
should reevaluate. Getting Marek's build logs and grepping through them
might guide us a bit on this...
I'm not sure what the rationale is for length of zero at level 1 and length
of one at higher levels for unknown strings. I guess I can kindof see the
former, though I suspect if we looked at the actual strings, zero length
would actually be uncommon.
For level 1 and above assuming a single character seems way too tolerant.
We're issuing a "may" warning, so ISTM we ought to be assuming a much larger
length here. I realize that makes a lot more noise for the warning, but
doesn't that better reflect what may happen?
If the compiler doesn't know anything useful about the string lengths
(and that is the case when the value range is VARYING or just extremely
large), then using the maximum bounds is really not useful at all.
We would then have to complain about every "%s %s" because in theory that
would not fit into address space and similar.
I'm well aware of that. But ISTM the choice of "1" is so lenient that
it makes tracking in those cases largely pointless -- at which point I
have to ask why bother tracking at all when we've got an unconstrained
string like that.
jeff