differences between <math.h> and gcc's <math.h>
Martin Sebor
sebor@roguewave.com
Fri Nov 2 14:46:00 GMT 2001
Can someone help me understand why the simple program below compiles
fine when it #includes <math.h> but fails when it #includes the very
same header using an absolute pathname? The two translation unit are
in fact quite different -- the one that #includes <math.h> contains
in addition a bunch of C99 functions (e.g., modff). I don't see any
differences in the output from gcc -v other than the name of the temp
file. This is on SunOS 5.8/i86.
Thanks
Martin
$ cat t.cpp ; gcc t.cpp -H -c -DMATH_H="\""`gcc t.cpp -H -c -DMATH_H="<math.h>"
2>&1 | head -1 | sed -n "s/^[^/]*\(\/.*\)/\1/p"`"\""
#include MATH_H
void foo ()
{
(void)&modff;
}
. /usr/local/gcc-3.0.1/lib/gcc-lib/i386-pc-solaris2.8/3.0.1/include/math.h
.. /usr/include/iso/math_iso.h
t.cpp: In function `void foo()':
t.cpp:5: `modff' undeclared (first use this function)
t.cpp:5: (Each undeclared identifier is reported only once for each function it
appears in.)
More information about the Gcc-bugs
mailing list