This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: -funsafe-loop-optimizations


Richard Henderson wrote:

And/or a -W option that warns for these sorts of loops so that
(a) we can see how often this happens, really, (b) so that users
can fix the presumed mistake.

Although warnings are desirable where easily given, I would say that you have to be careful about this. If the warning can be precise with no or few false positives, then presumably these situations are rare, and you might as well compile correct code for them.

If the warnings are imprecise, then false positives may be a real
problem. After all such an option gets installed because we think
it will have some useful effect on real programs. If this is the
case, then that translates into real programs generating false
positive warnings.

False positive warnings are quite a formidable enemy to quality,
because they encourage programmers to follow the evil practice
of turning off warnings or ignoring them (I am amazed how often
we get reports where there are clear significant warnings, but
no one pays attention to them).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]