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?
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.
This error looks like it has already been covered in Bug #27142. Chris, the glibc-2.3.2-r4 ebuild includes the relevant patch.
Added patch to -r1 and -r3 as well.