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++] RFC: partial C99 designated-initializers support


On Mon, 25 Oct 2004 13:17:03 +0200, Bernardo Innocenti <bernie@develer.com> wrote:

> For member initializers in constructors, we silently reorder the
> initialization (the warning is only enabled with -Wall).
>
> struct A {
>         int first, second;
>         A() : second(0), first(second) { /*nop*/ }
> };
>
> Maybe we could do the same for the C99 syntax, except that
> the warning would be always enabled since this behavior is
> not specified by the standard.

I wouldn't reorder aggregate initializers; I'd follow the C99 rule that
the member are initialized in the order that they are written.

>> Aside from that concern, I think it's a matter of only moderately much
>> work to make labeled initializers work in C++.  I think it would be
>> welcome, despite the fact that is not part of ISO C++, because,
>> generally, we're trying to support C99 in C++.  Other C++ maintainers
>> might have other opinions, though.

I agree.

Jason


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