This is the mail archive of the gcc-patches@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: Wfutile-unsigned-comparison (PR7651 Define -Wextra strictly in terms of other warning flags)


"Manuel López-Ibáñez" <lopezibanez@gmail.com> writes:

[...]

| > I think there is a switch for comparisons that are always true
| > because of type range limits.  I suspect this particular diagnostic
| > falls under that umbrella.
| 
| I wasn't able to find it and there are no so many -W* options in
| doc/invoke.texi.

yes, that is one of the reasons why some people have argued againts
option inflation.

| So please, point me to it and I will happily resubmit
| the patch. However, that would break current behaviour since that
| warning that you mention is not enabled by Wextra, so then what you
| propose to do? Enable it with Wextra or remove this warning from
| Wextra?

Instances of the warning I was thinking of are in the function 
shorten_compare(), c-common.c.  grep for "always true".
I now remember that there have been several requests to "name" that
diagnostic, i.e. control it by an option.  I think the diagnostic your
patch was addressing and this diagnostic are logically the same.

Currently, they are unconditional issued.  I think it should be
enabled by -Wall.


I don't think "futile" is appropriate.  -Wtautology?


-- Gaby


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