This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/36834] structure return ABI for windows targets differs from native MSVC



------- Comment #7 from mattias at virtutech dot se  2009-03-20 17:16 -------
The proposed patch works for plain C code, but also affects C++. Since
libstdc++ contains code that returns aggregates or calls code that does,
-mms-aggregate-return will make the generated code incompatible with the C++
library. This makes it impossible to write C++ code that links (as a DLL) to
code compiled with Microsoft or Intel compilers, even if the interface is in
plain C.

We are exactly in this situation. We will have to build libstdc++ with
-mms-aggregate-return, but that option would then become mandatory for all C++
code. Things would be easier if the option were on by default - we can do this
for our build locally, of course, but we'd rather not diverge too much from the
standard behaviour.

An alternative would be to make the option only affect C (including extern "C"
in C++), as other languages are not subject to compatibility with MS compilers.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36834


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]