This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
differences between <math.h> and gcc's <math.h>
- From: Martin Sebor <sebor at roguewave dot com>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 14 Nov 2001 13:13:28 -0700
- Subject: differences between <math.h> and gcc's <math.h>
- Organization: Rogue Wave Software, Inc.
[Get raw message]
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.)