public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/8293: C99 declaration syntax not accepted after case label
@ 2002-10-20 13:04 jsm28
  0 siblings, 0 replies; 2+ messages in thread
From: jsm28 @ 2002-10-20 13:04 UTC (permalink / raw)
  To: drepper, gcc-bugs, gcc-prs, jsm28, nobody

Synopsis: C99 declaration syntax not accepted after case label

State-Changed-From-To: open->closed
State-Changed-By: jsm28
State-Changed-When: Sun Oct 20 13:04:57 2002
State-Changed-Why:
    C99 does not allow it.  Statements and declarations may
    be mixed, but declarations are not a type of statement,
    and labels may only be applied to statements.  See
    block-item, 6.8.2#1, and labeled-statement, 6.8.1.
    
    As noted in a comment in c-parse.in, this is not
    implemented as a GCC extension because there would be
    a conflict between attributes on the label and on the
    declaration.

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


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

* c/8293: C99 declaration syntax not accepted after case label
@ 2002-10-20 12:26 drepper
  0 siblings, 0 replies; 2+ messages in thread
From: drepper @ 2002-10-20 12:26 UTC (permalink / raw)
  To: gcc-gnats


>Number:         8293
>Category:       c
>Synopsis:       C99 declaration syntax not accepted after case label
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Oct 20 12:26:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Ulrich Drepper
>Release:        gcc 3.2
>Organization:
>Environment:
Linux x86, but this is platform independent
>Description:
If a variable declaration follows directly to a case label the compiler reports an error.  C99 allows this and gcc must support it if -std=c99 or -stdc=gnu99 is used.

>How-To-Repeat:
Compile:

int foo (int x) { switch (x) { case 1: int y = x; return y; default: return x + 1; } }
>Fix:
N/A
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="u.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="u.c"

aW50IGZvbyAoaW50IHgpIHsgc3dpdGNoICh4KSB7IGNhc2UgMTogaW50IHkgPSB4OyByZXR1cm4g
eTsgZGVmYXVsdDogcmV0dXJuIHggKyAxOyB9IH0K


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

end of thread, other threads:[~2002-10-20 20:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-20 13:04 c/8293: C99 declaration syntax not accepted after case label jsm28
  -- strict thread matches above, loose matches on Subject: below --
2002-10-20 12:26 drepper

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).