fpermissive and bit-fields

Andolfato Luigi-LANDOLF1 luigi.andolfato@motorola.com
Wed Feb 21 02:05:00 GMT 2001


Hi,
 
why fpermissive flag 
doesn't convert errors into warning
when a structure 
identifier has the same name of a bit-field:
 
typedef struct 
platone   {
  int one : 
1;
  int platone : 
7;   <<=== syntax error before `:'
} 
PLATONE;
 
while:
 

typedef struct 
platone   {
  int 
one;
  int 
platone;  <<=== warning: ANSI C++ forbids data member `platone1' 
with same name as enclosing class
} 
PLATONE;
 
I use  gcc version 2.95.2 19991024 
(release)
and the following 
command line:
 
g++ -fpermissive 
-c filename.cpp 
 
 
Thanks in 
advance,
Luigi 
Andolfato
 
PS: I know that it's 
not according to the ANSI C++ standard
but I have to build 
a C++ system that uses old C headers.
 
 



More information about the Gcc-bugs mailing list