Re: Strange C++ function pointer test

2016-01-08 Thread Jonathan Wakely
On 7 January 2016 at 13:36, Jonathan Wakely wrote: > On 7 January 2016 at 13:14, Jonathan Wakely wrote: >> On 6 January 2016 at 21:05, Jonathan Wakely wrote: >>> I have been meaning to try solving it in libstdc++ with a new >>> that includes the libc one and extends it, to see how well that works.

Re: Strange C++ function pointer test

2016-01-07 Thread Jonathan Wakely
On 7 January 2016 at 13:14, Jonathan Wakely wrote: > On 6 January 2016 at 21:05, Jonathan Wakely wrote: >> I have been meaning to try solving it in libstdc++ with a new >> that includes the libc one and extends it, to see how well that works. >> I haven't had time to try that, so it would be prema

Re: Strange C++ function pointer test

2016-01-06 Thread Jonathan Wakely
On 4 January 2016 at 09:32, Florian Weimer wrote: > On 12/31/2015 01:31 PM, Jonathan Wakely wrote: >> On 31 December 2015 at 11:37, Marc Glisse wrote: >>> That's what I called "bug" in my message (there are a few bugzilla PRs for >>> this). It would probably work on Solaris. >> >> Yes, the case is

Re: Strange C++ function pointer test

2016-01-06 Thread Jonathan Wakely
On 2 January 2016 at 11:42, Jonathan Wakely wrote: > On 31 December 2015 at 18:49, James Dennett wrote: >> On Thu, Dec 31, 2015 at 4:42 AM, Jonathan Wakely >> wrote: >>> >>> On 31 December 2015 at 11:54, Dominik Vogt wrote: >>> > Is there a requirement for a certain minimum Glibc version for >>>

Re: Strange C++ function pointer test

2016-01-04 Thread Florian Weimer
On 12/31/2015 01:31 PM, Jonathan Wakely wrote: > On 31 December 2015 at 11:37, Marc Glisse wrote: >> That's what I called "bug" in my message (there are a few bugzilla PRs for >> this). It would probably work on Solaris. > > Yes, the case is still a mess in the standard and in glibc. > The "only

Re: Strange C++ function pointer test

2016-01-02 Thread Jonathan Wakely
On 31 December 2015 at 18:49, James Dennett wrote: > On Thu, Dec 31, 2015 at 4:42 AM, Jonathan Wakely > wrote: >> >> On 31 December 2015 at 11:54, Dominik Vogt wrote: >> > Is there a requirement for a certain minimum Glibc version for >> > this to work? >> >> It doesn't work with any glibc, becau

Re: Strange C++ function pointer test

2015-12-31 Thread Jonathan Wakely
On 31 December 2015 at 13:09, Dominik Vogt wrote: > On Thu, Dec 31, 2015 at 12:42:56PM +, Jonathan Wakely wrote: >> On 31 December 2015 at 11:54, Dominik Vogt wrote: >> > Is there a requirement for a certain minimum Glibc version for >> > this to work? >> >> It doesn't work with any glibc, bec

Re: Strange C++ function pointer test

2015-12-31 Thread Dominik Vogt
On Thu, Dec 31, 2015 at 12:42:56PM +, Jonathan Wakely wrote: > On 31 December 2015 at 11:54, Dominik Vogt wrote: > > Is there a requirement for a certain minimum Glibc version for > > this to work? > > It doesn't work with any glibc, because it doesn't declare the C++ overloads. All right, so

Re: Strange C++ function pointer test

2015-12-31 Thread Jonathan Wakely
On 31 December 2015 at 11:54, Dominik Vogt wrote: > Is there a requirement for a certain minimum Glibc version for > this to work? It doesn't work with any glibc, because it doesn't declare the C++ overloads. Libstdc++ has an include/c_compatibility/math.h header that would include (which declar

Re: Strange C++ function pointer test

2015-12-31 Thread Jonathan Wakely
On 31 December 2015 at 11:37, Marc Glisse wrote: > That's what I called "bug" in my message (there are a few bugzilla PRs for > this). It would probably work on Solaris. Yes, the case is still a mess in the standard and in glibc. The "only in namespace std in the second case" part is what I meant

Re: Strange C++ function pointer test

2015-12-31 Thread Jonathan Wakely
On 31 December 2015 at 11:34, Dominik Vogt wrote: > On Thu, Dec 31, 2015 at 10:11:55AM +, Jonathan Wakely wrote: >> is required to declare std::abs and it's unspecified whether >> it also declares it as ::abs. >> >> is required to declare ::abs and it's unspecified whether it >> also declares

Re: Strange C++ function pointer test

2015-12-31 Thread Dominik Vogt
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 > >static float (*p1_)(float) = abs; > >-- abs.C -- > > This is allowed to fail. If you include math.h (in addition or > inst

Re: Strange C++ function pointer test

2015-12-31 Thread Marc Glisse
On Thu, 31 Dec 2015, Dominik Vogt wrote: The minimal failing program is -- abs.C -- #include 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-

Re: Strange C++ function pointer test

2015-12-31 Thread Marc Glisse
On Thu, 31 Dec 2015, Jonathan Wakely wrote: There are other overloads of 'abs' declared in math.h / cmath (only in namespace std in the second case, and there are bugs (or standard issues) about having them in the global namespace for the first one). That's not quite accurate, C++11 was altere

Re: Strange C++ function pointer test

2015-12-31 Thread Dominik Vogt
On Thu, Dec 31, 2015 at 10:11:55AM +, Jonathan Wakely wrote: > On 31 December 2015 at 09:57, Marc Glisse wrote: > > On Thu, 31 Dec 2015, Dominik Vogt wrote: > > > >> This snippet ist from the Plumhall 2014 xvs test suite: > >> > >> #if CXX03 || CXX11 || CXX14 > >> static float (*p1_)(float) =

Re: Strange C++ function pointer test

2015-12-31 Thread Jonathan Wakely
On 31 December 2015 at 09:57, Marc Glisse wrote: > On Thu, 31 Dec 2015, Dominik Vogt wrote: > >> This snippet ist from the Plumhall 2014 xvs test suite: >> >> #if CXX03 || CXX11 || CXX14 >> static float (*p1_)(float) = abs; >> ... >> checkthat(__LINE__, p1_ != 0); >> #endif >> >> (With the tes

Re: Strange C++ function pointer test

2015-12-31 Thread Jonathan Wakely
On 31 December 2015 at 09:57, Jakub Jelinek wrote: > On Thu, Dec 31, 2015 at 10:49:18AM +0100, Dominik Vogt wrote: >> This snippet ist from the Plumhall 2014 xvs test suite: >> >> #if CXX03 || CXX11 || CXX14 >> static float (*p1_)(float) = abs; >> ... >> checkthat(__LINE__, p1_ != 0); >>

Re: Strange C++ function pointer test

2015-12-31 Thread Marc Glisse
On Thu, 31 Dec 2015, Dominik Vogt wrote: This snippet ist from the Plumhall 2014 xvs test suite: #if CXX03 || CXX11 || CXX14 static float (*p1_)(float) = abs; ... checkthat(__LINE__, p1_ != 0); #endif (With the testsuite specific macros doing the obvious). abs() is declared as: int abs

Re: Strange C++ function pointer test

2015-12-31 Thread Jakub Jelinek
On Thu, Dec 31, 2015 at 10:49:18AM +0100, Dominik Vogt wrote: > This snippet ist from the Plumhall 2014 xvs test suite: > > #if CXX03 || CXX11 || CXX14 > static float (*p1_)(float) = abs; > ... > checkthat(__LINE__, p1_ != 0); > #endif > > (With the testsuite specific macros doing the