* Anton Altaparmakov (ai...@ca...) [20040303 14:00]:
> We could do that. But I still don't see why we have to... We supply
> -fms-extensions, so why doesn't it work for some people? It seems to me
> every gcc version does something different with respect to anonymous
> structures/unions... gcc-2.96 worked as is, later gcc 3.something
> didn't work at all, then a later one worked with -fms-extensions. But
> people using various architecture ports of gcc still complain it doesn't
> work. Ugh...
Yes, gcc does have bugs, does that wonder?
> Would all our problems go away if we were to remove the use of anonymous
> structs and unions in typedefs (i.e. just removed the typedefs and used
> struct blah instead of blah) everywhere?
For current 3.X that should suffice.
> Would it then work with all versions of gcc? (including 2.95?) If not
> which versions would it work with? To make such a big move there would
> have to be a pretty good reason as it would mean making the next libntfs
> release no longer compatible with the previous one on both a binary and
> source code level...
Why would they be binary incompatible? The result of using 'struct foo;'
without -fms-extensions and 'foo;' with -fms-extensions should be identical,
so this change shouldn't affect the ABI.
> > Wouldn't the above not be enough reason to refrain from using such
> > constructs?
>
> No. (-: It works on MS Windows/Visual C++ so why shouldn't it work on
> Linux?
It works on MSVC++ because MS has sole control of that compiler and may
implement or not implement as they choose to do, including redefining things
the C standard defines differently.
The aim of the GCC developers is foremost to create a standard compliant
compiler and not to implement some obscure vendor extension.
If MS would have had sensible and farsighted folks in the compiler division,
they would have seen what a mess the use of unnamed structs/unions in
typedefs creates and would have left that out.
> It is very annoying not to be able to just copy some MS header
> files because of this issue...
I understand, but you're barking up the wrong tree :) Blame MS, not the GCC
folks.
Philipp
--
Philipp Thomas
SUSE LINUX AG, Maxfeldstr. 5, D-90409 Nuremberg, Germany
|