I am designing an API that has to be binary-compatible between at least mingw and msvc++. So far I have restricted myself to using function which take and return primitive data types or pointers to POD-structs with uniform members (i.e. the members are all of the same type, which should reduce the risk of incompatible padding).
It would be convenient at some points to return structs by value though, so that the callee does not need to keep a temporary copy. So the question is: Is it safe to pass structs by value to/from stdcall functions, when the callee was compiled by a different compiler than the caller? Does this still hold for less recent versions of msvc and mingw? I would be more confident that it is, but I found this topic discussing a problem in this exact situation with cdecl calling convention, which was apparently only solved in mingw 4.6.