Bug 24895 - glibc 2.2 has errors in tgmath.h
Summary: glibc 2.2 has errors in tgmath.h
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: glibc
Version: 7.0
Hardware: i386
OS: Linux
medium
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-01-24 23:57 UTC by Steve Lawler
Modified: 2016-11-24 15:03 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-01-25 17:10:49 UTC
Embargoed:


Attachments (Terms of Use)

Description Steve Lawler 2001-01-24 23:57:19 UTC
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

Comment 1 Jakub Jelinek 2001-01-25 17:08:57 UTC
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.

Comment 2 Jakub Jelinek 2001-02-12 09:49:03 UTC
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).


Note You need to log in before you can comment on or make changes to this bug.