This is the mail archive of the gcc-prs@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/7946: -std=gnu99 and casted empty srtuct initializers


Synopsis: -std=gnu99 and casted empty srtuct initializers

State-Changed-From-To: open->closed
State-Changed-By: jsm28
State-Changed-When: Tue Sep 17 08:24:50 2002
State-Changed-Why:
    This is deliberate.  C99 compound literals are not
    constant expressions but unnamed variables intitialized
    in a given way.  The code you give is equivalent to
    
    foo_t compound_literal = { };
    foo_t baz = compound_literal;
    
    which of course fails.  As an allowance for existing
    code written for old GNU compound literals rather than
    C99 compound literals (the Linux kernel), this case
    is permitted in gnu89 mode but not gnu99 mode.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7946


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