This is the mail archive of the libc-alpha@sourceware.cygnus.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]

union definition error in sysdeps/i386/fpu/bits/mathinline.h


>Submitter-Id:	net
>Originator:	Sean Chen
>Organization:	TurboLinux, Inc.
>Confidential:	no
>Synopsis:	union definition error in sysdeps/i386/fpu/bits/mathinline.h
>Severity:	critical
>Priority:	high
>Category:	libc
>Class:		sw-bug
>Release:	libc-2.1.90
>Environment:
Host type: i686-pc-linux-gnu
System: Linux cat.tlc.com.cn 2.3.48 #1 Mon Feb 28 17:38:33 CST 2000 i686 unknown
Architecture: i686

Addons: crypt linuxthreads soft-fp

Build CC: gcc
Compiler version: 2.95.2 19991024 (release)
Kernel headers: 2.3.48
Symbol versioning: yes
Build static: yes
Build shared: yes
Build pic-default: no
Build profile: yes
Build omitfp: no
Build bounded: no
Build static-nss: no
Stdio: libio

>Description:
In line 458 of sysdeps/i386/fpu/bits/mathinline.h, the union definition is:

union { long double __xld; unsigned int __xi[3]; } __n = { .__xld = __x };

But g++ can't parse '{ .__xld = __x }'.

>How-To-Repeat:
test.cc:

#include <math.h>

compile it:

# g++ -c -O2 test.cc
In file included from /usr/include/math.h:348,
                 from test.cc:1:
/usr/include/bits/mathinline.h: In function `long double __sgn1l(long double)':
/usr/include/bits/mathinline.h:457: parse error before `.'

>Fix:
ChangeLog:

	* sysdeps/i386/fpu/bits/mathinline.h: Fix union definition error
	in __sgn1l, otherwise g++ fails to parse this.
	Reported by Sean Chen <sean.chen@turbolinux.com>.

Patch:

--- sysdeps/i386/fpu/bits/mathinline.h.old	Tue Feb 29 11:04:25 2000
+++ sysdeps/i386/fpu/bits/mathinline.h	Mon Mar  6 14:55:29 2000
@@ -455,7 +455,7 @@
 __inline_mathcode (acos, __x, return __atan2l (__sqrtl (1.0 - __x * __x), __x))
 
 __inline_mathcode_ (long double, __sgn1l, __x, \
-  union { long double __xld; unsigned int __xi[3]; } __n = { .__xld = __x };  \
+  union { long double __xld; unsigned int __xi[3]; } __n = { __xld: __x };  \
   __n.__xi[2] = (__n.__xi[2] & 0x8000) | 0x3fff;			      \
   __n.__xi[1] = 0x80000000;						      \
   __n.__xi[0] = 0;							      \

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