tgmath.h _does not_ work (causes compiler errors) with gcc-2.96-69 and glibc-2.2-12. It _does_ work with kgcc/egcs-1.1.12-40 and glibc-2.1.13, and with kgcc/egcs-1.1.12-40 and glibc-2.2-12. The following code, in particular, will not work: foo.c: #include <math.h> #include <stdlib.h> #include <tgmath.h> int main(int argc, char **argv) { double x = atof(argv[1]); double a; a = cos(x); return !(a == 1.0); } % gcc -Wall foo.c -o foo -lm foo.c: In function `main': foo.c:10: parse error before `{' foo.c:10: parse error before `else' % kgcc -Wall foo.c -o foo -lm % if ./foo 0.0 ; then echo hi ; fi hi
This has actually nothing to do with gcc (kgcc succeeds to compile it only because it picks tgmath.h from glibc 2.1.3 compatibility headers, if you pass -I/usr/include to kgcc it will fail the same way). I've submitted a patch for this http://sources.redhat.com/ml/libc-hacker/2001-01/msg00120.html hope this will get resolved soon.
This should be fixed in glibc-2.2.1-7. In addition to this, you probably want cpp-2.96-74 and above, since otherwise some macros from tgmath.h might be preprocessed wrongly (namely, if one uses some particular tgmath.h macros as arguments to other tgmath.h macros).