This is the mail archive of the libc-alpha@sources.redhat.com 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]

Re: Implementation of <tgmath.h>


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   `------------------------

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