This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: g++ 2.96 -W issues bogus warning for conditional expression with enum and unsigned
- To: sebor at roguewave dot com
- Subject: Re: g++ 2.96 -W issues bogus warning for conditional expression with enum and unsigned
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Thu, 6 Jul 2000 09:06:46 +0200
- CC: gcc-bugs at gcc dot gnu dot org, <nathan at acm dot org>
- References: <3962C10C.5DF7D614@roguewave.com>
> 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