public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c/7963: gnu99 doesn't allow compound literals for static initializers
@ 2002-09-17 22:56 mrs
  0 siblings, 0 replies; 2+ messages in thread
From: mrs @ 2002-09-17 22:56 UTC (permalink / raw)
  To: gcc-gnats


>Number:         7963
>Category:       c
>Synopsis:       gnu99 doesn't allow compound literals for static initializers
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 17 22:56:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     mrs@apple.com
>Release:        gcc version 3.1 20020420
>Organization:
>Environment:

>Description:
GNU gnu99 is missing a feature, compound literals for static initializers should be accepted in gnu99 mode, as they are in gnu89 mode.

http://gcc.gnu.org/onlinedocs/gcc/Compound-Literals.html#Compound%20Literals
typedef struct A { int i; } At;

void foo() {
  static At a = (At){0};
  static int y[] = (int []) {1, 2, 3};
}

bash-2.05a$ gcc -c -xc t3.m -std=gnu99
t3.m: In function `foo':
t3.m:4: initializer element is not constant
t3.m:5: array initialized from non-constant array expression

See also Radar 3033979.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: c/7963: gnu99 doesn't allow compound literals for static initializers
@ 2002-09-18 18:21 rth
  0 siblings, 0 replies; 2+ messages in thread
From: rth @ 2002-09-18 18:21 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, mrs, nobody

Synopsis: gnu99 doesn't allow compound literals for static initializers

State-Changed-From-To: open->closed
State-Changed-By: rth
State-Changed-When: Wed Sep 18 18:21:19 2002
State-Changed-Why:
    Not a bug.  Duplicate of 7946 and 7958.

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-09-19  1:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-17 22:56 c/7963: gnu99 doesn't allow compound literals for static initializers mrs
2002-09-18 18:21 rth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).