This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: PATCH RFA: -Wc++-compat warning about ++/-- with enum value


On Thu, 14 May 2009, Ian Lance Taylor wrote:

> 2009-05-14  Ian Lance Taylor  <iant@google.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
joseph@codesourcery.com


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