On Thu, Dec 31, 2015 at 12:45:06PM +0100, Marc Glisse wrote:
> On Thu, 31 Dec 2015, Dominik Vogt wrote:
> 
> >The minimal failing program is
> >
> >-- abs.C --
> >#include <stdlib.h>
> >static float (*p1_)(float) = abs;
> >-- abs.C --
> 
> This is allowed to fail. If you include math.h (in addition or
> instead of stdlib.h), it has to work (gcc bug if it doesn't).
> 
> See also
> http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#2294

Understood.  So, this should work in any case but doesn't

-- abs.C --
#include <stdlib.h>
#include <math.h>
static float (*p1_)(float) = abs;
-- abs.C --

$ g++ -std=c++11 abs.C -Wsystem-headers
abs.C:3:30: error: invalid conversion from ‘int (*)(int) throw ()’ to ‘float 
(*)(float)’ [-fpermissive]
 static float (*p1_)(float) = abs;
                                ^~~

Is there a requirement for a certain minimum Glibc version for
this to work?

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt
IBM Germany

Reply via email to