Therefore, at work, I am working on a C ++ application that works without a C ++ runtime library. We use Visual Studio 2005 and specified the / NODEFAULTLIB switch.
The solution is organized in such a way that there are various projects of the static library, and then one executable project that uses these libraries. Libraries are basically ordinary libraries, tracked in a separate repository. They can be changed, but we better not do this if we can avoid it.
One of these shared libraries uses floating point math. Since we do not have C ++ runtime, we ourselves determined these routines (for example: _ftol2_sseto convert float to int).
From my (rather limited) understanding of low-level details, the compiler produces a symbol _fltusedthat it is necessary to use mathematical floating point routines.
For some reason, one of the other shared libraries decides to define this symbol manually, as
extern "C" { unsigned short _fltused = 0; };
When I turn on Generating the entire program and creating the time code, I get
warning C4743: '_fltused' has different size ...
when binding. I do not know why we declared it as unsigned shortinstead int, but it is how.
When I do not allow optimization of the entire program or LTCG, the warning disappears.
I have two questions.
- Can I ignore this warning?
- What is the optimization that triggers a warning? I am not sure why this is not a warning without optimizing the entire program.
UPDATE
, , , . , , _fltused .
user1096614