Re: [C PATCH] Enable initializing statics with COMPOUND_LITERAL_EXPR in C99 (PR c/63567)

2014-10-17 Thread Joseph S. Myers
On Fri, 17 Oct 2014, Marek Polacek wrote: > Bootstrapped/regtested on x86_64-linux, ok for trunk? > > 2014-10-17 Marek Polacek > > PR c/63567 > * c-typeck.c (digest_init): Allow initializing objects with static > storage duration with compound literals even in C99 and add pe

Re: [C PATCH] Enable initializing statics with COMPOUND_LITERAL_EXPR in C99 (PR c/63567)

2014-10-17 Thread Marek Polacek
On Fri, Oct 17, 2014 at 03:53:46PM +, Joseph S. Myers wrote: > On Fri, 17 Oct 2014, Marek Polacek wrote: > > > Building Linux kernel failed with 'error: initializer element is not > > constant', because they're initializing objects with static storage > > duration with (T){ ...} - and that isn

Re: C/C++ diagnostics guidelines (was: Re: [C PATCH] Enable initializing statics with COMPOUND_LITERAL_EXPR in C99 (PR c/63567))

2014-10-17 Thread Manuel López-Ibáñez
On 17 October 2014 20:04, Manuel López-Ibáñez wrote: > On 17 October 2014 19:33, Joseph S. Myers wrote: >> On Fri, 17 Oct 2014, Manuel López-Ibáñez wrote: >> >>> Thus, I drafted some guidelines >>> at:https://gcc.gnu.org/wiki/Better_Diagnostics#guidelines >>> >>> Please, could you take a look and

Re: C/C++ diagnostics guidelines (was: Re: [C PATCH] Enable initializing statics with COMPOUND_LITERAL_EXPR in C99 (PR c/63567))

2014-10-17 Thread Manuel López-Ibáñez
On 17 October 2014 19:33, Joseph S. Myers wrote: > On Fri, 17 Oct 2014, Manuel López-Ibáñez wrote: > >> Thus, I drafted some guidelines >> at:https://gcc.gnu.org/wiki/Better_Diagnostics#guidelines >> >> Please, could you take a look and comment whether I got it right/wrong? > > Yes, that looks rig

Re: C/C++ diagnostics guidelines (was: Re: [C PATCH] Enable initializing statics with COMPOUND_LITERAL_EXPR in C99 (PR c/63567))

2014-10-17 Thread Joseph S. Myers
On Fri, 17 Oct 2014, Manuel López-Ibáñez wrote: > Thus, I drafted some guidelines > at:https://gcc.gnu.org/wiki/Better_Diagnostics#guidelines > > Please, could you take a look and comment whether I got it right/wrong? Yes, that looks right to me. -- Joseph S. Myers jos...@codesourcery.com

C/C++ diagnostics guidelines (was: Re: [C PATCH] Enable initializing statics with COMPOUND_LITERAL_EXPR in C99 (PR c/63567))

2014-10-17 Thread Manuel López-Ibáñez
> The Right Thing is for -pedantic not to cause errors, only warnings > (-pedantic-errors being needed for an error). So rather than having this > conditional for whether to allow the extension at all, make the > conditional code do a pedwarn (if flag_isoc99, otherwise there will > already have be

Re: [C PATCH] Enable initializing statics with COMPOUND_LITERAL_EXPR in C99 (PR c/63567)

2014-10-17 Thread Joseph S. Myers
On Fri, 17 Oct 2014, Marek Polacek wrote: > Building Linux kernel failed with 'error: initializer element is not > constant', because they're initializing objects with static storage > duration with (T){ ...} - and that isn't permitted in gnu99/gnu11. > > I think the Right Thing is to allow some

[C PATCH] Enable initializing statics with COMPOUND_LITERAL_EXPR in C99 (PR c/63567)

2014-10-17 Thread Marek Polacek
Building Linux kernel failed with 'error: initializer element is not constant', because they're initializing objects with static storage duration with (T){ ...} - and that isn't permitted in gnu99/gnu11. I think the Right Thing is to allow some latitude here and enable it even in gnu99/gnu11 unles