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 for constant expression constraints in preprocessor


"Joseph S. Myers" <jsm@polyomino.org.uk> writes:

> Although constant expression constraints in the compiler are extremely
> complicated, those in the preprocessor are simple (largely because of
> the lack of casts, sizeof and floating point constants).  (The
> _semantics_ are also simple once the correction of DR#265 is applied.)
> I think the following patch is all that is needed to follow the
> constraints of the various standard versions: unlike C99, C90 and C++
> do not permit comma expressions in constant expressions at all outside
> of sizeof, even in other unevaluated subexpressions.  (Note that this
> patch only addresses a small part of bug 456.)
>
> Boostrapped with no regressions on i686-pc-linux-gnu.  OK to commit to
> mainline and 3.4 branch (this is a regression in C90 mode relative to
> 3.2.3, 3.0.4 and 2.95.3)?

Ok.

>
> 2004-02-11  Joseph S. Myers  <jsm@polyomino.org.uk>
>
> 	PR c/456
> 	* cppexp.c (num_binary_op): Don't allow comma operators in #if
> 	constant expressions at all outside C99 mode if pedantic.
>
> testsuite:
> 2004-02-11  Joseph S. Myers  <jsm@polyomino.org.uk>
>
> 	PR c/456
> 	* gcc.dg/cpp/c90-if-comma-1.c, gcc.dg/c99-if-comma-1.c: New tests.


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