Bug 24895 - glibc 2.2 has errors in tgmath.h
glibc 2.2 has errors in tgmath.h
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
7.0
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-01-24 18:57 EST by Steve Lawler
Modified: 2016-11-24 10:03 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-01-25 12:10:49 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Steve Lawler 2001-01-24 18:57:19 EST
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 12:08:57 EST
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 04:49:03 EST
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.