------- Comment #3 from bangerth at dealii dot org 2007-09-22 04:10 ------- It seems rather hard to diagnose this. If you change the ABI by using a floating point representation using a different size of builtin types, you probably have to build all libraries that you link with with the same flags or the kind of wreak that you describe will happen.
Now, the bigger question is of course whether the compiler can help you detect the case where you ignore that rule, i.e. compile an object file created with -m128bit-long-double with a libc that was compiled without. The compiler is, in this case, actually the wrong tool to do so -- if anything, the linker could do that, but it would have to have some sort of clue that the object files (or libraries) that you link together were created with incompatible flags -- and worse that you also intend to call functions that will be incompatible with each other if called across object file boundaries. I think that we don't want to go down this avenue. It probably amounts to solving the halting problem if the linker had to make that determination. For example, it may be that you didn't re-compile your libc but never intended to call any libc functions that take floating point arguments. Then there is no danger. Or you intend to call printf which takes all arguments through ... and therefore transparently to the linker. So if you call printf only ever with integer arguments, then your program is ok, but if you call it with fp args then you're in trouble. I guess this is a case where we simply have to trust that you know what you're doing because trying to second guess will just lead to an incredible complex code that will be wrong too often... So I concur with Andrew, though I think he could have explained things a bit nicer :-) W. -- bangerth at dealii dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bangerth at dealii dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33521