Implementation of <tgmath.h>
Ulrich Drepper
drepper@redhat.com
Tue Aug 1 15:51:00 GMT 2000
This leaves the path of sanity but so be it. I've taken Joseph's
proposal, added yet more gcc magic and have now in the CVS archive a
version of <tgmath.h> which should be standard compliant (as long as
gcc does not learn about _Imaginary). The code is not comprehensible
anymore without really understanding the language and gcc but it seems
to work. Using this
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include <tgmath.h>
#ifndef E
#define E 1
#endif
int
main ()
{
return cos (cos (cos (E))) != 0;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I compile run
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drepper@myware $ gcc -c co.c -O -g && nm co.o
U cos
00000000 T main
drepper@myware $ gcc -c co.c -O -g -DE=1.0 && nm co.o
U cos
00000000 T main
drepper@myware $ gcc -c co.c -O -g -DE=1.0f && nm co.o
U cosf
00000000 T main
drepper@myware $ gcc -c co.c -O -g -DE=1.0L && nm co.o
U cosl
00000000 T main
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thanks, Joseph.
--
---------------. ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Red Hat `--' drepper at redhat.com `------------------------
More information about the Libc-alpha
mailing list