This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

printf more equal than sin?


Hi all,

the very elementary question I was asked by a friend and that I was not 
able to answer is: for the use of "sin"(math.h) I have to specify "-lm", 
for the use of "printf"(stdio.h) I have to specify nothing (when using gcc 
version 4.1.2 on i486-linux-gnu target). I acknowlegde the man page 
(man 3 sin) prominently says "Link with -lm" but that alone is not a very 
satisfying explanation.

Where is it documented (in glibc sources, glibc documentation,
gcc sources, binutils sources, the C standard or the ABI) for which 
functions of the standard library specifying nothing is ok (like
"printf") and for which this is not ok (like: "sin" needing "-lm")?

Thanks,

-- 
Holger Blasum 
GnuPG 1024D/ACDFC3B769DC1ED66B47
Phone (cell) +49-174-7313590



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]