(Yet another) Bug in C compiler (SCO Xenix V/386 R 2.3.1)

Ralf Moritz trepex at tmpmbx.UUCP
Wed Sep 20 22:38:58 AEST 1989


In article <12744 at eddie.MIT.EDU> eliot%lees-rif.MIT.EDU at eddie.MIT.EDU (Eliot Frank) writes:
>When I compile the code fragment below I get an error

Another little bug with tan() - also very easy to "fix" :-)

Op Sys: SCO Xenix V/386 R2.3.2	
Dev Sys: SCO Xenix V/386 R2.3.0

$ cat test.c

#include <math.h>
main()
{
	double x;
	x = 1.0;
#ifdef BUG
	printf("tan(%f) = %f\n", x, tan(x));
#else
	printf("tan(%f) = %f\n", x, sin(x)/cos(x));
#endif
}

$ cc -o bug -DBUG -lm test.c
test.c

/bin/ld : error: Unresolved externals:
_xtan in file(s):
 /lib/386/Slibm.a(tan.c)

$ cc -o nobug -lm test.c ; nobug
test.c

tan(1.000000) = 1.557408

Ralf
--
UUCP:	trepex at tmpmbx	(Bang: ...!uunet!unido!tmpmbx!trepex)
BITNET:	moritz at db0tui6	(Ralf Moritz, netmbx GbR)



More information about the Comp.unix.xenix mailing list