Re: [PATCH] PR libstdc++/79789 fix non-reserved names in headers
On 10/03/17 15:20 +, Jonathan Wakely wrote: On 09/03/17 19:46 +, Jonathan Wakely wrote: On 03/03/17 10:47 -0500, David Edelsohn wrote: This patch caused a new regression on AIX. I'm unable to bootstrap on either gcc111 or gcc119 so I can't test the fix. export CONFIG_SHELL=/usr/bin/bash PATH=/opt/freeware/bin:$PATH $gccsrcdir/configure ... --disable-werror --with-included-gettext --with-gmp=/opt/cfarm --with-libiconv-prefix=/opt/cfarm --disable-libstdcxx-pch Here's what I'm committing to trunk. Tested powerpc64le-linux and powerpc-ibm-aix7.2.0.0 Also committed to gcc-5-branch and gcc-6-branch. commit 5e390a2874a9629c13eaddb76f82a66f0634a864 Author: Jonathan Wakely Date: Fri Mar 10 13:14:33 2017 + Fix libstdc++ reserved names test to pass on AIX * testsuite/17_intro/names.cc: Undefine macros that clash with identifiers in AIX system headers. diff --git a/libstdc++-v3/testsuite/17_intro/names.cc b/libstdc++-v3/testsuite/17_intro/names.cc index a7d9a6b..c525861 100644 --- a/libstdc++-v3/testsuite/17_intro/names.cc +++ b/libstdc++-v3/testsuite/17_intro/names.cc @@ -98,4 +98,13 @@ #define x ( #define y ( #define z ( + +#ifdef _AIX +// See https://gcc.gnu.org/ml/libstdc++/2017-03/msg00015.html +#undef f +#undef r +#undef x +#undef y +#endif + #include
Re: [PATCH] PR libstdc++/79789 fix non-reserved names in headers
On Fri, Mar 10, 2017 at 10:20 AM, Jonathan Wakely wrote: > On 09/03/17 19:46 +, Jonathan Wakely wrote: >> >> On 03/03/17 10:47 -0500, David Edelsohn wrote: >>> >>> This patch caused a new regression on AIX. >> >> >> I'm unable to bootstrap on either gcc111 or gcc119 so I can't test >> the fix. > > > export CONFIG_SHELL=/usr/bin/bash > PATH=/opt/freeware/bin:$PATH > $gccsrcdir/configure ... --disable-werror --with-included-gettext > --with-gmp=/opt/cfarm --with-libiconv-prefix=/opt/cfarm > --disable-libstdcxx-pch > > Here's what I'm committing to trunk. > > Tested powerpc64le-linux and powerpc-ibm-aix7.2.0.0 Great! Thank you very much! - David
Re: [PATCH] PR libstdc++/79789 fix non-reserved names in headers
On 09/03/17 19:46 +, Jonathan Wakely wrote: On 03/03/17 10:47 -0500, David Edelsohn wrote: This patch caused a new regression on AIX. I'm unable to bootstrap on either gcc111 or gcc119 so I can't test the fix. export CONFIG_SHELL=/usr/bin/bash PATH=/opt/freeware/bin:$PATH $gccsrcdir/configure ... --disable-werror --with-included-gettext --with-gmp=/opt/cfarm --with-libiconv-prefix=/opt/cfarm --disable-libstdcxx-pch Here's what I'm committing to trunk. Tested powerpc64le-linux and powerpc-ibm-aix7.2.0.0 commit 5e390a2874a9629c13eaddb76f82a66f0634a864 Author: Jonathan Wakely Date: Fri Mar 10 13:14:33 2017 + Fix libstdc++ reserved names test to pass on AIX * testsuite/17_intro/names.cc: Undefine macros that clash with identifiers in AIX system headers. diff --git a/libstdc++-v3/testsuite/17_intro/names.cc b/libstdc++-v3/testsuite/17_intro/names.cc index a7d9a6b..c525861 100644 --- a/libstdc++-v3/testsuite/17_intro/names.cc +++ b/libstdc++-v3/testsuite/17_intro/names.cc @@ -98,4 +98,13 @@ #define x ( #define y ( #define z ( + +#ifdef _AIX +// See https://gcc.gnu.org/ml/libstdc++/2017-03/msg00015.html +#undef f +#undef r +#undef x +#undef y +#endif + #include
Re: [PATCH] PR libstdc++/79789 fix non-reserved names in headers
On 03/03/17 10:47 -0500, David Edelsohn wrote: This patch caused a new regression on AIX. I'm unable to bootstrap on either gcc111 or gcc119 so I can't test the fix. - David FAIL: 17_intro/names.cc (test for excess errors) Excess errors: /tmp/GCC/gcc/include-fixed/sys/types.h:600: error: expected unqualified-id before '[' token /tmp/GCC/gcc/include-fixed/sys/types.h:600: error: expected ')' before '[' token /tmp/GCC/gcc/include-fixed/sys/types.h:668: error: expected unqualified-id before '[' token /tmp/GCC/gcc/include-fixed/sys/types.h:668: error: expected ')' before '[' token /tmp/GCC/gcc/include-fixed/stdlib.h:332: error: 'parameter' declared as function returning a function /tmp/GCC/gcc/include-fixed/stdlib.h:332: error: expected primary-expression before 'void' /tmp/GCC/gcc/include-fixed/math.h:1458: error: expected unqualified-id before ',' token /tmp/GCC/gcc/include-fixed/math.h:1458: error: expected ')' before ',' token AIX types.h:600 is typedef struct { int r[1]; } * physadr_t; stdlib.h:332 is extern int at_quick_exit(void (*f)(void)); math.h:1458 is struct dbl_hypot { double x, y; };
Re: [PATCH] PR libstdc++/79789 fix non-reserved names in headers
On 03/03/17 10:47 -0500, David Edelsohn wrote: This patch caused a new regression on AIX. - David FAIL: 17_intro/names.cc (test for excess errors) Excess errors: /tmp/GCC/gcc/include-fixed/sys/types.h:600: error: expected unqualified-id before '[' token /tmp/GCC/gcc/include-fixed/sys/types.h:600: error: expected ')' before '[' token /tmp/GCC/gcc/include-fixed/sys/types.h:668: error: expected unqualified-id before '[' token /tmp/GCC/gcc/include-fixed/sys/types.h:668: error: expected ')' before '[' token /tmp/GCC/gcc/include-fixed/stdlib.h:332: error: 'parameter' declared as function returning a function /tmp/GCC/gcc/include-fixed/stdlib.h:332: error: expected primary-expression before 'void' /tmp/GCC/gcc/include-fixed/math.h:1458: error: expected unqualified-id before ',' token /tmp/GCC/gcc/include-fixed/math.h:1458: error: expected ')' before ',' token AIX types.h:600 is typedef struct { int r[1]; } * physadr_t; stdlib.h:332 is extern int at_quick_exit(void (*f)(void)); math.h:1458 is struct dbl_hypot { double x, y; }; I think the AIX headers should be using reserved names there, but this should fix it: --- a/libstdc++-v3/testsuite/17_intro/names.cc +++ b/libstdc++-v3/testsuite/17_intro/names.cc @@ -55,7 +55,9 @@ // and defined data members called c #define d ( #define e ( +#ifndef _AIX #define f ( +#endif #define g ( #if __cplusplus >= 201402L // defines operator ""h in C++14 @@ -84,7 +86,9 @@ #define p ( #endif #define q ( +#ifndef _AIX #define r ( +#endif #if __cplusplus >= 201103L // defines member functions called s() and t() // and define operator ""s in C++14 @@ -95,7 +99,9 @@ #define u ( #define v ( #define w ( +#ifndef _AIX #define x ( #define y ( +#endif #define z ( #include I'll test it later today.
Re: [PATCH] PR libstdc++/79789 fix non-reserved names in headers
This patch caused a new regression on AIX. - David FAIL: 17_intro/names.cc (test for excess errors) Excess errors: /tmp/GCC/gcc/include-fixed/sys/types.h:600: error: expected unqualified-id before '[' token /tmp/GCC/gcc/include-fixed/sys/types.h:600: error: expected ')' before '[' token /tmp/GCC/gcc/include-fixed/sys/types.h:668: error: expected unqualified-id before '[' token /tmp/GCC/gcc/include-fixed/sys/types.h:668: error: expected ')' before '[' token /tmp/GCC/gcc/include-fixed/stdlib.h:332: error: 'parameter' declared as function returning a function /tmp/GCC/gcc/include-fixed/stdlib.h:332: error: expected primary-expression before 'void' /tmp/GCC/gcc/include-fixed/math.h:1458: error: expected unqualified-id before ',' token /tmp/GCC/gcc/include-fixed/math.h:1458: error: expected ')' before ',' token AIX types.h:600 is typedef struct { int r[1]; } * physadr_t; stdlib.h:332 is extern int at_quick_exit(void (*f)(void)); math.h:1458 is struct dbl_hypot { double x, y; };
Re: [PATCH] PR libstdc++/79789 fix non-reserved names in headers
On 2 March 2017 at 05:25, Jonathan Wakely wrote: > Some of these are years old, most are more recent. The new testcase > should help prevent us trying to use these names again. > > PR libstdc++/79789 > * include/bits/hashtable_policy.h (__clp2): Use reserved names for > parameters and local variables. > * include/bits/ios_base.h (make_error_code, make_error_condition): > Likewise. > * include/bits/list.tcc (list::sort): Likewise. > * include/bits/mask_array.h (mask_array): Likewise. > * include/bits/regex.h (regex_token_iterator): Likewise. > * include/bits/slice_array.h (slice_array): Likewise. > * include/bits/stl_algo.h (__sample): Likewise. > * include/std/memory (undeclare_no_pointers): Likewise. > * include/std/type_traits (is_callable_v, is_nothrow_callable_v): > Likewise. > * libsupc++/exception_ptr.h (__dest_thunk): Likewise. > * testsuite/17_intro/headers/names.cc: New test. I meant to put this new test in 17_intro not 17_intro/headers, so I've moved it. * testsuite/17_intro/headers/names.cc: Rename to ... * testsuite/17_intro/names.cc: ... here. > Tested powerpc64le-linux, committed to trunk. > > I'll backport pieces of this as appropriate to the branches. Done.