public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c/7948: gcc fails to fault gnu extension with -std=c99
@ 2002-09-17  6:56 Richard Earnshaw
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Earnshaw @ 2002-09-17  6:56 UTC (permalink / raw)
  To: gcc-gnats


>Number:         7948
>Category:       c
>Synopsis:       gcc fails to fault gnu extension with -std=c99
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          accepts-illegal
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 17 06:56:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Richard Earnshaw
>Release:        3.3 20020917 (experimental)
>Organization:
ARM
>Environment:
System: Linux pc960.cambridge.arm.com 2.4.7-10 #1 Thu Sep 6 17:27:27 EDT 2001 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: arm-unknown-elf
configured with: /home/rearnsha/gnusrc/egcs-cross/configure --prefix=/work/rearnsha/gnu/install --disable-checking --target=arm-elf --with-headers=/home/rearnsha/gnusrc/egcs-cross/newlib/libc/include
>Description:
	ISO C99 states that a variable length array may only be used with
	"ordinary identifiers" (ie not structure members).  That makes the
	following code invalid:

	void f(int len)
	{
	  struct {
	    char x[len];
	  } a;
	  /* ... */
	}

	However, gcc accepts this without complaint if the -std=c99 flag is
	used (even if -pedantic is given).

>How-To-Repeat:
	compile the above code fragment with

		gcc -c -std=c99 -pedantic 

	Note that the fragment _is_ correctly rejected if -std=c89 is used.

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


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

* Re: c/7948: gcc fails to fault gnu extension with -std=c99
@ 2002-09-17  8:27 jsm28
  0 siblings, 0 replies; 2+ messages in thread
From: jsm28 @ 2002-09-17  8:27 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, jsm28, nobody, rearnsha

Synopsis: gcc fails to fault gnu extension with -std=c99

State-Changed-From-To: open->analyzed
State-Changed-By: jsm28
State-Changed-When: Tue Sep 17 08:27:48 2002
State-Changed-Why:
    Confirmed.  More people were complaining about getting
    warnings with -std=c99 -pedantic for the cases C99 permits
    than are now complaining about not getting warnings for
    cases it doesn't permit.  VLAs are documented as broken
    (meaning not closely following C99) in c99status.html.

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


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

end of thread, other threads:[~2002-09-17 15:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-17  6:56 c/7948: gcc fails to fault gnu extension with -std=c99 Richard Earnshaw
2002-09-17  8:27 jsm28

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