------- Comment #1 from pinskia at gcc dot gnu dot org 2008-03-26 17:38 -------
This is a front-end issue.
C++ calls it at:
3952 /* Do not warn if the comparison is an equality operation,
3953 the unsigned quantity is an integral constant and it does
3954 not use the most significant bit of result_type. */
3955 else if ((resultcode == EQ_EXPR || resultcode == NE_EXPR)
3956 && ((op0_signed && TREE_CODE (orig_op1) ==
INTEGER_CST
3957 && int_fits_type_p (orig_op1,
c_common_signed_type
3958 (result_type)))
While C does:
8499 /* Do not warn if the comparison is an equality
operation,
8500 the unsigned quantity is an integral constant, and
it
8501 would fit in the result if the result were signed.
*/
8502 else if (TREE_CODE (uop) == INTEGER_CST
8503 && (resultcode == EQ_EXPR || resultcode ==
NE_EXPR)
8504 && int_fits_type_p
8505 (uop, c_common_signed_type (result_type)))
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|middle-end |c
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35430