D - Bug or syntax error: struct definitions in anonymous struct/union?
- Russ Lewis (19/19) Sep 20 2002 I have been converting my program, which previously used unnamed types,
- Walter (3/22) Sep 22 2002 It looks like a compiler bug. -Walter
I have been converting my program, which previously used unnamed types,
to use only named struct types. However, you can't do that inside an
anonymous struct or union:
union { // anonymous
struct _a { ... }
_a a; // syntax error, "identifier '_a' is not defined"
}
I have to hackishly move the struct definition out of the union:
struct _a { ... }
union {
_a a;
}
Maybe we need a new keyword for "unnamed struct variable" that can work
more like the old C++ style?
--
The Villagers are Online! villagersonline.com
.[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ]
.[ (a version.of(English).(precise.more)) is(possible) ]
?[ you want.to(help(develop(it))) ]
Sep 20 2002
It looks like a compiler bug. -Walter
"Russ Lewis" <spamhole-2001-07-16 deming-os.org> wrote in message
news:3D8BA059.8D4DF2A8 deming-os.org...
I have been converting my program, which previously used unnamed types,
to use only named struct types. However, you can't do that inside an
anonymous struct or union:
union { // anonymous
struct _a { ... }
_a a; // syntax error, "identifier '_a' is not defined"
}
I have to hackishly move the struct definition out of the union:
struct _a { ... }
union {
_a a;
}
Maybe we need a new keyword for "unnamed struct variable" that can work
more like the old C++ style?
--
The Villagers are Online! villagersonline.com
.[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ]
.[ (a version.of(English).(precise.more)) is(possible) ]
?[ you want.to(help(develop(it))) ]
Sep 22 2002








"Walter" <walter digitalmars.com>