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