3 ms·
My memory on this specific issue is a bit fuzzy, but as far as I remember the issue was regarding the definition/ABI compatibility of C++ member functions. The
by Andoryuuta 5y ago
My memory on this specific issue is a bit fuzzy, but as far as I remember the issue was regarding the definition/ABI compatibility of C++ member functions. The doc you linked aren't really clear what to do in the case of C++ member functions, as they always take a hidden "this" class instance pointer as the first argument (in MSVC). So which one is passed first when you have both?
If you look at godbolt/or disassembly output of an MSVC compiled binary, you can find that it is actually passing the class pointer first, then the return value pointer. Which definitely doesn't match the absolute "the caller must allocate memory for the return value and pass a pointer to it as the first argument" statement from their own docs.
Prior discussion about this at https://news.ycombinator.com/item?id=29613640 https://news.ycombinator.com/item?id=29613640