I am developing an API that should be binary compatible between at least mingw and msvC ++. So far I have limited myself to using a function that accepts and returns primitive data types or pointers to POD structures with homogeneous members (i.e., Members are of the same type, which should reduce the risk of incompatible filling).
In some cases, it would be convenient to return structures by value, so the caller does not need to save a temporary copy. Therefore, the question arises: is it safe to pass structures by value to / from stdcall functions when the caller was compiled by a different compiler than the caller? Does this persist for less recent versions of msvc and mingw? I would be sure that it is, but I found this topic discussing the problem in this exact situation with the cdecl calling convention, which apparently was solved in mingw 4.6.
source
share