From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050524 Fedora/1.0.4-4 Firefox/1.0.4 Description of problem: According to bytee in #fedora-ppc ceil(2.0/4.0) and ceil(.4) work correctly. But if you say double c=.4; and did ceil(c), it would fail stating ceil.c:8: undefined reference to `ceil'. Version-Release number of selected component (if applicable): gcc-4.0.0-8 How reproducible: Always Steps to Reproduce: 1. Get ztclock.c from http://www.xs4all.nl/~pjl/ztclock.c 2. gcc -I. -O3 -g -Wall ./ztclock.c -o ./ztclock 3. Actual Results: /tmp/ccO1s5dm.o(.text+0x1a4): In function `main': ./ztclock.c:52: undefined reference to `ceilf' collect2: ld returned 1 exit status Expected Results: Successful compilation. Additional info: If I remove the -O3 and compile I get: /tmp/ccEzptmb.o(.text+0x2b8): In function `main': ./ztclock.c:52: undefined reference to `ceil' collect2: ld returned 1 exit status Note the search for "ceil" and not "ceilf" If I compile with -lm the compilation is successful: gcc -lm -I. -O3 -g -Wall ./ztclock.c -o ./ztclock
And the bug is where? -lm of course must be used when you use functions implemented in libm. Also, please learn to place libraries last on the command line, otherwise things don't work very well at least when statically linking or using nonshared auxiliary libraries (e.g. -lc or -lpthread have such aux libs, -lm ATM doesn't, but that could change).