This is the mail archive of the
mailing list for the GCC project.
Re: Wfutile-unsigned-comparison (PR7651 Define -Wextra strictly in terms of other warning flags)
"Manuel López-Ibáñez" <firstname.lastname@example.org> 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
yes, that is one of the reasons why some people have argued againts
| 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
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?