c++/7385: g++ problems with enum and __attribute__
gusti@pallas.dk
gusti@pallas.dk
Tue Jul 23 05:16:00 GMT 2002
>Number: 7385
>Category: c++
>Synopsis: g++ problems with enum and __attribute__
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Jul 23 05:16:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Agust Karlsson
>Release: 3.1
>Organization:
>Environment:
Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
Configured with: ../gcc-3.1/configure --prefix=/usr
Thread model: single
gcc version 3.1
>Description:
When using g++ frontend, these erroers occure:
test.cpp:4: non-local function `void g1(<anonymous enum>)' uses anonymous type
test.cpp:7: non-local function `void g2(<anonymous enum>)' uses anonymous type
But NOT if using gcc
Commands used are:
g++ -Wall -c test.cpp
gcc -Wall -c test.c
on the same code.
>How-To-Repeat:
// how to declare and use a packed enum ?
typedef enum { v11=1, v12=2 } e1 __attribute__ ((packed));
void g1( e1 par) {}
typedef enum { v21=1, v22=2} e2 __attribute__ ((packed));
void g2( e2 par) {}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-prs
mailing list