libstdc++-v3 configure question

Jeffrey A Law law@cygnus.com
Thu Apr 19 12:11:00 GMT 2001


When libstdc++-v3 is configured it does tests to determine what library
functions are declared in header files and exist in system libraries.

Some of the functions we test for are not part of the ANSI standard such
as acosf.

On hpux the declarations of those functions are protected by conditionals
like  this:

#ifdef _HPUX_SOURCE
 ... decls
#endif



When we configure libstdc++ we run the compiler without any special flags
and the compiler will define _HPUX_SOURCE -- which results in acosf and
friends being properly found in math.h during the configury process.

However, when we run the g++ testsuite, we compile a lot of things with
"-ansi" which causes GCC to _not_ define _HPUX_SOURCE.  And thus we get errors
like this:

  In file included from /portal/fall/gcc-3.0/libstdc++-v3/include/bits/std_comp
lex.h:43,^M
                 from /portal/fall/gcc-3.0/libstdc++-v3/include/std/complex:2,^
M
                 from /portal/fall/gcc-3.0/gcc/testsuite/g++.old-deja/g++.brend
an/crash20.C:3:^M
/portal/fall/gcc-3.0/libstdc++-v3/include/c_std/bits/std_cmath.h: In function 
`float std::acos(float)':^M
/portal/fall/gcc-3.0/libstdc++-v3/include/c_std/bits/std_cmath.h:120: 
`::acosf' undeclared (first use here)^M
/portal/fall/gcc-3.0/libstdc++-v3/include/c_std/bits/std_cmath.h: In function 
`float std::asin(float)':^M
/portal/fall/gcc-3.0/libstdc++-v3/include/c_std/bits/std_cmath.h:128: 
`::asinf' undeclared (first use here)^M
/portal/fall/gcc-3.0/libstdc++-v3/include/c_std/bits/std_cmath.h: In function 
`float std::atan(float)':^M
/portal/fall/gcc-3.0/libstdc++-v3/include/c_std/bits/std_cmath.h:136: 
`::atanf' undeclared (first use here)^M


Sooooo.

Do we want the libstdc++ configury process to specify -ansi when it runs
the compiler?  Or should GCC always define _HPUX_SOURCE (seems wrong to me).
Or should we hack up the g++ testsuite?  Or is there some other direction we
want to go to fix this problem?

Jeff









More information about the Gcc mailing list