* Anton Altaparmakov (ai...@ca...) [20030327 17:20]:
> I disagree that it is gross. Microsoft compilers work with it just fine.
We don't disagree that much :) I agree that anonymous structs and unions are
indeed a usefull abstraction. It's the use of anonymous typedef'd
structs/unions I find gross.
And I'll bet you this will *never* make it into an official C standard. This
was only implemented in gcc in order to allow the mingw port to use MS
headers. I'm quite sure that if it wasn't for mingw, this would *never* have
been accepted for gcc.
Quoting from gcc's c-decl.c(grokfield):
/* This is an unnamed decl.
If we have something of the form "union { list } ;" then this
is the anonymous union extension. Similarly for struct.
If this is something of the form "struct foo;", then
If MS extensions are enabled, this is handled as an
anonymous struct.
Otherwise this is a forward declaration of a structure tag.
If this is something of the form "foo;" and foo is a TYPE_DECL, then
If MS extensions are enabled and foo names a structure, then
again this is an anonymous struct.
Otherwise this is an error.
Oh what a horrid tangled web we weave. I wonder if MS consciously
took this from Plan 9 or if it was an accident of implementation
that took root before someone noticed the bug... */
The main part for me is that "struct foo;" has a defined meaning in ISO C99
and this meaning is suddenly changed when -fms-extensions is used.
But as you're the Maintainer, it's your decision to make. Find attached the
patches for super.c and for ntfs/Makefile to make it use
-fms-extensions.
2003-27.03.2003 Philipp Thomas <pt...@su...>
* Makefile: Use -fms-extensions if gcc groks it.
* super.c(parse_ntfs_boot_sector): Correct the check for 64-bit
clusters.
--
Philipp Thomas <pt...@su...>
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nuremberg, Germany
|