This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, committed] PR c++/29089
- From: Roger Sayle <roger at eyesopen dot com>
- To: Dirk Mueller <dmuell at gmx dot net>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 29 Oct 2006 12:53:05 -0700 (MST)
- Subject: Re: [PATCH, committed] PR c++/29089
Hi Dirk,
On Sun, 29 Oct 2006, Dirk Mueller wrote:
> another simple one from the huge diagnostic buglist of the c++ frontend.
> compiled and manually tested, committed as obvious.
I hate to be the bearer of bad news, but neither this nor your previous
obvious patch for PR29033 adhere to required the GNU/GCC code coding style
guidelines.
> - pedwarn ("ISO C++ forbids %sing an enum",
> - (code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR)
> - ? "increment" : "decrement");
> + pedwarn ((code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR) ?
> + "ISO C++ forbids incrementing an enum" :
> + "ISO C++ forbids decrementing an enum");
The GNU coding rules require that when wrapping lines, operators appear
on the second line, indented/aligned under the start of the expression.
Hence,
a
? b
: c
is acceptable, as is
a
? b : c
and at a stretch even
a ? b
: c
and the (in my opinion slightly uglier)
a ? b
: c
But your usage of
a ?
b :
c
and previously of
a ? b :
c
are incorrect.
And placing a "?" on a line by itself is "right out" :-).
Sorry for any inconvenience. I hope this helps.
Roger
--