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: C PATCH for PR64856 (initializing range of elements in C99)


On 02/09/2015 11:51 AM, Marek Polacek wrote:
> We reject the following testcase in C99 mode, because in C99 we always
> wrap COMPOUND_LITERAL_EXPR in a SAVE_EXPR when initializing a range of
> elements, even though the expression is required to be constant.  As a
> consequence, we error out with "initializer element is not constant".
> It's been like this since Roger's fold changes in 2003.  Since the default
> is now gnu11, I think we should accept the code even in C99.  So this patch
> makes the C FE treat the expression the same in both C90/C99 modes.  There
> is no need to add any pedwarns at this spot.

Ah, I see, the pedwarn already exists elsewhere.  That threw me for a bit.

The patch is ok.


r~


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