Kierrow
Kierrow

Reputation: 681

Is Microsoft Visual C++ not using the C/C++ calling conventions with floats?

I've been researching floating-point numbers for my compiler projects, especially how they are converted from decimal notation to bytes. I did find answers to all of my questions, but this YouTube video got me worried.

The guy explains SSE and the instruction set pretty good and I did understand everything, but he also mentions that Microsoft's Visual C++ apparently does not use the _stdcall calling convention when it comes to floats. This would be terrible for me as I was planning to use the C calling convention in my own compiler, for calling extern functions as well, of course.

Basic question: Do I have to worry about this, or is it even true?

The main aspect of this is whether Visual C++ also does this when exporting code to a DLL, as this could turn out to be a problem.

Upvotes: 0

Views: 201

Answers (1)

Stephen Canon
Stephen Canon

Reputation: 106167

As MSalters indicated in a comment, there is no such thing as "the C/C++ calling conventions". The calling conventions for both C and C++ depend on the platform (compiler, runtime, OS, and hardware), and are not mentioned anywhere in the C or C++ standards.

It sounds like you want to use __stdcall, which has nothing to do with any actual standard as far as I'm aware, despite its name.

Upvotes: 1

Related Questions