This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C PATCH for PR64856 (initializing range of elements in C99)
- From: Richard Henderson <rth at redhat dot com>
- To: Marek Polacek <polacek at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Joseph Myers <joseph at codesourcery dot com>
- Date: Mon, 09 Feb 2015 12:54:57 -0800
- Subject: Re: C PATCH for PR64856 (initializing range of elements in C99)
- Authentication-results: sourceware.org; auth=none
- References: <20150209195131 dot GG28333 at redhat dot com>
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~