What I understand is that this shouldn\'t be done, but I believe I\'ve seen examples that do something like this (note code is not necessarily syntactically correct but the
Let's add a second part to the question: Does this vary by compiler?
Indeed it does, as I discovered to my pain: http://sourceforge.net/p/mingw-w64/mailman/message/33176880/
I was using gcc on win32 (MinGW) to call COM interfaces that returned structs. Turns out that MS does it differently to GNU and so my (gcc) program crashed with a smashed stack.
It could be that MS might have the higher ground here - but all I care about is ABI compatibility between MS and GNU for building on Windows.
If it does, then what is the behavior for the latest versions of compilers for desktops: gcc, g++ and Visual Studio
You can find some messages on a Wine mailing list about how MS seems to do it.