This is the mail archive of the gcc-bugs@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]

Re: g++ 2.96 -W issues bogus warning for conditional expression with enum and unsigned


> the program below issues a warning when compiled with gcc -W. This new
> warning (it was not present in 2.95.2) disappears if the type of the
> third subexpression is int.
> 
> I don't see a reason for the warning in 5.16, p6.

Thanks for your bug report. The message you see is indeed not a
diagnostic message ([defns.diagnostic]); instead, I believe it is a
warning about a potential programming mistakes. It was introduced by

1999-09-02  Nathan Sidwell  <nathan@acm.org>

	* call.c (build_conditional_expr): Warn on enum mismatches.

so maybe Nathan can comment about the exact rationale for this
warning, and point to the exact place in the documentation where this
warning is documented.

> PS Also, the text of the warning is unnecessarily broken up into two
> lines.

That is not a bug; it's a feature. See the documentation of
-fmessage-length for details.

Regards,
Martin

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