This is the mail archive of the
mailing list for the GCC project.
Re: PATCH RFA: -Wc++-compat warning about ++/-- with enum value
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Thu, 14 May 2009 16:34:22 +0000 (UTC)
- Subject: Re: PATCH RFA: -Wc++-compat warning about ++/-- with enum value
- References: <firstname.lastname@example.org>
On Thu, 14 May 2009, Ian Lance Taylor wrote:
> 2009-05-14 Ian Lance Taylor <email@example.com>
> * c-typeck.c (build_unary_op): If -Wc++-compat, warn about using
> ++ or -- with a variable of enum type.
As with other C warnings I think this should have two separate calls to
warning_at with separate sentences for increment and decrement rather than
saying "increment/decrement", and should not say "pre/post" (other C
diagnostics don't say that, and don't divide things up into for
diagnostics to distinguish the pre and post cases). OK with that change.
"increment of enumeration value is invalid in C++"
"decrement of enumeration value is invalid in C++"
Joseph S. Myers