[Bug c/20573] unable to use cast to suppress "warning: comparison is always false due to limited range of data type"

sthoenna at efn dot org gcc-bugzilla@gcc.gnu.org
Mon Mar 21 03:49:00 GMT 2005


------- Additional Comments From sthoenna at efn dot org  2005-03-21 03:49 -------
Subject: Re:  unable to use cast to suppress "warning: comparison is always false due to limited range of data type"

On Mon, Mar 21, 2005 at 12:24:32AM -0000, pinskia at gcc dot gnu dot org wrote:
> 
> ------- Additional Comments From pinskia at gcc dot gnu dot org  2005-03-21 00:24 -------
> A better way is to just to suppress the warning point, see PR 12963.

But I don't want to suppress the warning in general; it's a valuable
warning.  I just want to be able to have a macro that takes an
arbitrarily sized int and compares it.
 
> *** This bug has been marked as a duplicate of 12963 ***

Thanks.  I mistakenly searched Comments containing '"comparison is
always"' instead of 'comparison is always' :) or I would have found
that one.

It's interesting to note that the apparent ending point of the discussion
there is my starting point: that a cast should suppress the warning (but
I would hope not the optimization).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20573



More information about the Gcc-bugs mailing list