3 ms·
> For the same CPU architecture, compiler and FPU control word, you should expect the same results. Wait a minute, does that mean that floating point types don
by FooBarWidget 17y ago
> For the same CPU architecture, compiler and FPU control word, you should expect the same results.
Wait a minute, does that mean that floating point types don't have a stable ABI? If I have a library with function foo(float bar) compiled with compiler A, then it's not safe to compile an app - that uses that library - with compiler B?
- barrkel 17y agoBy results, I meant computational results. The ABI is more a product of what type declarations you have to use to get interoperability on any given platform, and the platform vendor's compiler sets the lead here. For example, the following C statement: printf("%d\n", sizeof(long double)); gives the following results on my box: Cygwin gcc: 12 MSVC: 8 Embarcadero bcc32: 10 So yes, if you are assuming that foo(long double bar) - that specific header definition - compiled with compiler A will be binary compatible when compiled with compiler B, then you are not necessarily safe. Just `float`, though, is rather more solid.