https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92956

--- Comment #12 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #11)
> Because like all flow-based warnings, -Wstringop-overflow has a non-zero rate
> of false positives

I think false positive is okay fine, but the question is whether the option
should then be enabled by default. – That's independent whether it is C, C++ or
Fortran. I think someone who use several -W… options is fine with false
positives, but those who use only default options should not see bogus results.

Or split this in two parts – one for those parts before the problematic GIMPLE
optimizations – enabled by default (at least for C/C++). And another option for
warnings after GIMPLE "messed up" which the user has to specify explicitly
(might also be implied by -Wextra or maybe even -Wall).

> LTO builds are known to have issues with interpreting command line options,

My feeling is that this more a problem of GIMPLE doing optimization that about
LTO and command-line options. — At least comment 11 and PR 92765 look like C
code to me.

> If this warning is useful even in FORTRAN despite the non-zero false
> positive rate […] the option can be made generic

I think it has some use – a bit more limited as it is not as easy as in C to
run into such string bugs, but it can detect some issues also in Fortran code.
– As in C but due to the limited benefit even more so: it as a whole – or at
least those parts after the GIMPLE optimization – should only be enabled by a
-W flag (might well be implied, e.g., by -Wextra).

Reply via email to