Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 28537 - glibc2.3.2-r1 header causes gcc-3.3.1-r1 compile error
Summary: glibc2.3.2-r1 header causes gcc-3.3.1-r1 compile error
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-12 10:40 UTC by Chris Platt
Modified: 2003-09-13 13:49 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Platt 2003-09-12 10:40:53 UTC
Today, while rebuilding various packages due to a hardware upgrade, I got the 
following while emerging ttmkfdir-3.0.9: 
 
g++ -Wall -pedantic -I/usr/include/freetype2 -march=athlon -m3dnow -msse 
-mfpmath=sse -mmmx -O3 -pipe -fforce-addr -fomit-frame-pointer -funroll-loops 
-frerun-cse-after-loop -frerun-loop-opt -falign-functions=4 
-maccumulate-outgoing-args -ffast-math -fprefetch-loop-arrays -c ttmkfdir.cpp  
-fPIC -DPIC -o .libs/ttmkfdir.lo 
In file included from /usr/include/math.h:362, 
                 from 
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/include/g++-v3/cmath:51, 
                 from 
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/include/g++-v3/bits/locale_facets.tcc:41, 
                 from 
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/include/g++-v3/locale:47, 
                 from 
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/include/g++-v3/bits/ostream.tcc:37, 
                 from 
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/include/g++-v3/ostream:535, 
                 from 
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/include/g++-v3/iostream:45, 
                 from ttmkfdir.cpp:2: 
/usr/include/bits/mathinline.h: In function `long double __expm1l(long double) 
   ': 
/usr/include/bits/mathinline.h:385: error: ISO C++ forbids omitting the middle 
   term of a ?: expression 
/usr/include/bits/mathinline.h: In function `double expm1(double)': 
/usr/include/bits/mathinline.h:532: error: ISO C++ forbids omitting the middle 
   term of a ?: expression 
/usr/include/bits/mathinline.h: In function `float expm1f(float)': 
/usr/include/bits/mathinline.h:532: error: ISO C++ forbids omitting the middle 
   term of a ?: expression 
/usr/include/bits/mathinline.h: In function `long double expm1l(long double)': 
/usr/include/bits/mathinline.h:532: error: ISO C++ forbids omitting the middle 
   term of a ?: expression 
make: *** [ttmkfdir.o] Error 1 
 
 
The offending line (384) in /usr/include/bits/mathinline.h is: 
 
  return __temp + __value ?: __x 
 
 
I changed the line to read: 
 
  return __temp + __value!=0 ? __value : __x 
 
 
The emerge worked correctly from that point, but I'm not 100% sure the syntax 
matches the intent of the original code.  I've personally never seen or used a 
shorthand version of the ?: construct before.  Anyone wanna verify this?
Comment 1 Chris Platt 2003-09-12 12:38:19 UTC
After poking around I found some information that leads me to believe this was 
fixed in glibc-2.3.2 but maybe the patch didn't make it to glibc-2.3.2-r1.  
Here's a quote: 
 
http://mail.gnu.org/archive/html/bug-glibc/2003-08/msg00055.html 
 
>> apparantly, this has been fixed already:  
>>  
>> bits/mathinline.h: 383: 
>>   ... 
>>   __temp -= 1.0;                                  \ 
>>   __temp += __value;                                  \ 
>>   return __temp ? __temp : __x 
>>   ... 
>> i'm using gentoo linux / glibc 2.3.2 
> 
>Maybe it's fixed in the gentoo distribution. 
>But it's still open in mainline glibc (I just checked the CVS). 
 
 
I'll probably use that code for now until the next gcc/glibc update. 
 
Comment 2 Brandy Westcott (RETIRED) gentoo-dev 2003-09-13 06:08:15 UTC
This error looks like it has already been covered in Bug #27142. 
 
Chris, the glibc-2.3.2-r4 ebuild includes the relevant patch. 
Comment 3 Martin Schlemmer (RETIRED) gentoo-dev 2003-09-13 13:49:33 UTC
Added patch to -r1 and -r3 as well.