This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
printf more equal than sin?
- From: Holger Blasum <holger-r-glibc at blasum dot net>
- To: libc-help at sourceware dot org
- Date: Wed, 22 Oct 2008 18:44:49 +0200
- Subject: 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