Like i386-netware, the native MS Windows compiler assumes that the CALLER pops the stack for the implicit arguments pointing to aggregate return value. This differs from the default i386 ABI which assumes the CALLEE pops the stack.
This is documented at http://www.angelcode.com/dev/callconv/callconv.html in the section on __cdecl calling convention. The bug was reported to mingw users list by Magnus Christensson at: http://www.nabble.com/Problem-returning-C-struct-from-MinGW-to-MSVC-td18444899.html This report contains a testcase demostrating the problem. Danny -- Summary: structure return ABI for windows targets differs from nbative MSVC Product: gcc Version: 4.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: dannysmith at users dot sourceforge dot net GCC build triplet: i686-pc-mingw32 GCC host triplet: i686-pc-mingw32 GCC target triplet: i686-pc-mingw32 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36834