Bug 13741 - Compilation fail with g++ 3.3.6 with option -ffast-math due to undefined macros __extern_always_inline
Summary: Compilation fail with g++ 3.3.6 with option -ffast-math due to undefined macr...
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: math (show other bugs)
Version: 2.15
: P2 minor
Target Milestone: ---
Assignee: Marek Polacek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-24 09:39 UTC by Michael Uleysky
Modified: 2014-06-26 15:16 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Uleysky 2012-02-24 09:39:55 UTC
Very simple testcase test.cpp
#include <math.h>
int main() { return 0; }

g++-3.3.6 -o t -ffast-math test.cpp
In file included from /usr/include/math.h:424,
                 from test.cpp:1:
/usr/include/bits/math-finite.h:177: error: syntax error before `double'
/usr/include/bits/math-finite.h:186: error: syntax error before `float'
/usr/include/bits/math-finite.h:196: error: syntax error before `long'
/usr/include/bits/math-finite.h:210: error: syntax error before `double'
/usr/include/bits/math-finite.h:219: error: syntax error before `float'
/usr/include/bits/math-finite.h:229: error: syntax error before `long'
/usr/include/bits/math-finite.h:307: error: syntax error before `double'
/usr/include/bits/math-finite.h:310: error: `__d' was not declared in this 
   scope
/usr/include/bits/math-finite.h:310: error: `__local_signgam' was not declared 
   in this scope
/usr/include/bits/math-finite.h:311: error: syntax error before `return'
/usr/include/bits/math-finite.h:314: error: syntax error before `float'
/usr/include/bits/math-finite.h:317: error: conflicting types for `float __res'
/usr/include/bits/math-finite.h:310: error: previous declaration as `double 
   __res'
/usr/include/bits/math-finite.h:317: error: `__d' was not declared in this 
   scope
/usr/include/bits/math-finite.h:317: error: `__local_signgam' was not declared 
   in this scope
/usr/include/bits/math-finite.h:318: error: syntax error before `return'
/usr/include/bits/math-finite.h:322: error: syntax error before `long'
/usr/include/bits/math-finite.h:325: error: conflicting types for `long double 
   __res'
/usr/include/bits/math-finite.h:317: error: previous declaration as `float 
   __res'
/usr/include/bits/math-finite.h:325: error: `__d' was not declared in this 
   scope
/usr/include/bits/math-finite.h:325: error: `__local_signgam' was not declared 
   in this scope
/usr/include/bits/math-finite.h:326: error: syntax error before `return'

The root of problem is simple: in this case macros __extern_always_inline not defined. Also, the problem is observed only with g++, not gcc.
Comment 1 Marek Polacek 2012-02-24 09:44:18 UTC
Please use newer version of g++.  The 3.3.6 version is now deprecated.
Comment 2 Jakub Jelinek 2012-02-24 09:52:23 UTC
Actually that is not the case.  GCC 3.3.6 isn't supported for building of glibc itself, still, compiling with GCC 3.3.6 your own programs against glibc headers and linking against it is supported.
Comment 3 Joseph Myers 2012-03-02 01:03:50 UTC
Conditioning these definitions on __extern_always_inline being defined is probably the appropriate fix.
Comment 4 Marek Polacek 2012-08-31 10:47:02 UTC
Mine.
Comment 5 Marek Polacek 2012-09-26 11:01:53 UTC
Should be fixed by b7bfe116.