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: RFA: PATCHes to accept C99 designated initializer syntax in C++


On Wed, Jul 20, 2011 at 02:13:55PM -0400, Jason Merrill wrote:
> The first patch adjusts the C++ front end's current support for the
> old GNU designated initializer syntax to support the C99 syntax as
> well.

Thanks.

> The second patch adjusts recog.h/genoutput.c to use a new macro
> HAVE_DESIGNATED_UNION_INITIALIZERS instead of
> HAVE_DESIGNATED_INITIALIZERS because with the above change, the uses
> there work with the C++ compiler, but the uses in dwarf2asm.c still
> don't because they involve out-of-order initialization.
> 
> I'm applying the first patch to trunk.  Is the second patch OK as
> well, or should use of designated initializers in recog.h wait until
> the C++ front end supports the dwarf2asm.c use as well?

I think it is fine to start using it now, if the C++ front end gets support
even for more complicated designated initializers, we can revert that
second patch (if it happens during 4.7 timeframe).

BTW, optabs.c up to 4.5 was also using:
#if GCC_VERSION >= 4000 && HAVE_DESIGNATED_INITIALIZERS
__extension__ struct convert_optab_d convert_optab_table[COI_MAX]
  = { [0 ... COI_MAX - 1].handlers[0 ... NUM_MACHINE_MODES - 1]
        [0 ... NUM_MACHINE_MODES - 1].insn_code
      = CODE_FOR_nothing };
#else
/* init_convert_optab will do runtime initialization otherwise.  */
struct convert_optab_d convert_optab_table[COI_MAX];
#endif
haven't looked exactly with what 4.6 replaced this with and if it
wasn't just because C++ doesn't support designated initializers.

	Jakub


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