Missed Combined ABI with Long Double Change in GCC 4.4

I have a union with a long double field.

I initialize the field and pass it to the function.

my_union foo; foo.long_double = 10.10; bar = baz(foo); 

When compiling this code, I get:

 the ABI of passing union with long double has changed in GCC 4.4 

This seems to be due to the changes mentioned here: http://gcc.gnu.org/gcc-4.4/changes.html

Does this mean that I can not transfer the union with a long double field? Why is this? And how can I solve this, since I want to use long double to store large values.

+7
source share
2 answers

This means that the resulting code is not binary compatible with code compiled with previous versions of GCC, so if you transfer it between libraries between binaries compiled with the current version and the previous version, this will not work. (see comments for memory layout information for network transport and saving files)

As you can see from the link above:

Code built with previous versions of GCC that uses any of these is not compatible with code built with GCC 4.4.0 or later.

Either do not do this, or make sure that all of your code that uses the unions mentioned in the change list is compiled in the same version of the compiler (or technically ABI).

http://en.wikipedia.org/wiki/Application_binary_interface

+9
source

Try using the -msse2 or -march = k8 options when compiling

0
source

All Articles