Bug 24895 - glibc 2.2 has errors in tgmath.h
Summary: glibc 2.2 has errors in tgmath.h
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: glibc   
(Show other bugs)
Version: 7.0
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: David Lawrence
Depends On:
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:
Story Points: ---
Clone Of:
Last Closed: 2001-01-25 17:10:49 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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:

	#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

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