On Thu, Dec 31, 2015 at 12:42:56PM +0000, Jonathan Wakely wrote: > On 31 December 2015 at 11:54, Dominik Vogt wrote: > > Is there a requirement for a certain minimum Glibc version for > > this to work? > > It doesn't work with any glibc, because it doesn't declare the C++ overloads.
All right, so, the situation is: * The test includes just stdlib.h and math.h. * The test expects the float variant of abs to be available. * It tests the C++ compiler on C code, so it *does not* use any C++ specific code (namespace or C++ headers). * The C++-11 standard does *not* require that any overloaded variants of abs() are available when inclding math.h, right? ==> The assumption that the test should compile without error is bogus? The test seems to assume that including math.h with the C++ compiler is the same as including cmath. > Libstdc++ has an include/c_compatibility/math.h header that would > include <cmath> (which declares the C++ overloads) and then pull them > into the global namespace, but that isn't used on GNU/Linux, and would > create other problems. > > This is already in Bugzilla: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60401 Yet this bug report wants stdlib.h (or math.h) included from C++ to add the non-int signatures to the abs() function? Ciao Dominik ^_^ ^_^ -- Dominik Vogt IBM Germany