S
Sensei
I have a quick question about the math library included in the standard
C90 (and 99).
The gcc, xlc and possibly other compilers/linkers on some unix
platforms cannot use any math functions in math.h if a switch (-lm) is
used, so *explicitly* having the linker use a file called libm.so or
libm.a/dylib/whatever.
Is it true on all the platforms? (answer: probably no)
Is this a break on the standard?
Since abs(), sqrt() and all the math.h defined funcions/types ARE
(correct me if I make a mistake) put into the ISO C, any compiler and
any linker should NOT use an external library other than the standard C
library for those funcions. Is it so? Is the libc defined in the
standard having also math.h? If not, the separation seems to say ``math
is not in the standard c library, you must use something from outside''.
C90 (and 99).
The gcc, xlc and possibly other compilers/linkers on some unix
platforms cannot use any math functions in math.h if a switch (-lm) is
used, so *explicitly* having the linker use a file called libm.so or
libm.a/dylib/whatever.
Is it true on all the platforms? (answer: probably no)
Is this a break on the standard?
Since abs(), sqrt() and all the math.h defined funcions/types ARE
(correct me if I make a mistake) put into the ISO C, any compiler and
any linker should NOT use an external library other than the standard C
library for those funcions. Is it so? Is the libc defined in the
standard having also math.h? If not, the separation seems to say ``math
is not in the standard c library, you must use something from outside''.