c/4640: unnamed enums inside struct typedef

fnf@ninemoons.com fnf@ninemoons.com
Sun Oct 21 12:06:00 GMT 2001


>Number:         4640
>Category:       c
>Synopsis:       latest gcc produces new error on previously accepted code
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Sun Oct 21 12:06:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Fred Fish
>Release:        3.1 20011021 (experimental)
>Organization:
>Environment:
System: Linux fishpond.ninemoons.com 2.4.2-2smp #1 SMP Sun Apr 8 20:21:34 EDT 2001 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: /src/sourceware/gcc/gcc/configure -v --prefix=/usr/sourceware --enable-shared : (reconfigured)  : (reconfigured) 
>Description:
	The latest development gcc rejects code that was previously accepted.
	It's not clear (at least to me) if this is a bug, or a case of gcc now
	validly rejected code that is in fact noncompliant with the C standard.
>How-To-Repeat:

  $ cat j.c
  typedef struct {
    enum { A, B}; /* values for x */
    int x;
  } z;

  $ which gcc
  /usr/sourceware/bin/gcc

  $ gcc -v
  Reading specs from /usr/sourceware/lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
  Configured with: /src/sourceware/gcc/gcc/configure -v --prefix=/usr/sourceware --enable-shared : (reconfigured)  : (reconfigured)
  Thread model: single
  gcc version 3.1 20011021 (experimental)

  $ gcc -c j.c
  j.c:2: unnamed fields of type other than struct or union are not allowed

  $ /usr/bin/gcc -v
  Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
  gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-81)

  $ /usr/bin/gcc -c j.c
  $

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



More information about the Gcc-prs mailing list