Re: bison-3.2 make fails on Solaris 11.3 x86/64
Akim Demaille wrote: data/c.m4 is code that is emitted in the generated parsers in C (this snippet is only about glr.c as a matter of fact). Sorry, didn't know that. We could ship and install and use _Noreturn.h from gnulib to Bison’s sharedir. That'd be OK, but the current approach works and that's probably good enough.
Re: bison-3.2 make fails on Solaris 11.3 x86/64
I installed the attached patch to Gnulib, which should fix the problem there. If Gnulib defines _Noreturn, doesn't that render the _Noreturn definition in Bison's c.m4 unnecessary? >From 5821ccc02d138bfcb9dcc4f39bfb2abe87c9d5ed Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 2 Nov 2018 14:09:35 -0700 Subject: [PATCH] gnulib-common.m4: port _Noreturn to C++ Problem reported by Akim Demaille in: https://lists.gnu.org/r/bug-bison/2018-10/msg00067.html * m4/gnulib-common.m4 (gl_COMMON_BODY): If C++, use [[noreturn]]. Merge adjustments from _Noreturn.h and from glibc into the non-C++ version. * lib/_Noreturn.h: Match gnulib-common. --- ChangeLog | 10 ++ lib/_Noreturn.h | 12 m4/gnulib-common.m4 | 15 +-- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 94f8e919f..bbf379b8c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2018-11-02 Paul Eggert + + gnulib-common.m4: port _Noreturn to C++ + Problem reported by Akim Demaille in: + https://lists.gnu.org/r/bug-bison/2018-10/msg00067.html + * m4/gnulib-common.m4 (gl_COMMON_BODY): If C++, use [[noreturn]]. + Merge adjustments from _Noreturn.h and from glibc into the non-C++ + version. + * lib/_Noreturn.h: Match gnulib-common. + 2018-10-30 Bruno Haible gnu-make: Fix for NetBSD 8 'make'. diff --git a/lib/_Noreturn.h b/lib/_Noreturn.h index c44ad89b7..94fdfaf02 100644 --- a/lib/_Noreturn.h +++ b/lib/_Noreturn.h @@ -1,8 +1,12 @@ -#if !defined _Noreturn && __STDC_VERSION__ < 201112 -# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ - || 0x5110 <= __SUNPRO_C) +#ifndef _Noreturn +# if 201103 <= (defined __cplusplus ? __cplusplus : 0) +# define _Noreturn [[noreturn]] +# elif (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \ +|| 4 < __GNUC__ + (7 <= __GNUC_MINOR__)) + /* _Noreturn works as-is. */ +# elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C # define _Noreturn __attribute__ ((__noreturn__)) -# elif 1200 <= _MSC_VER +# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0) # define _Noreturn __declspec (noreturn) # else # define _Noreturn diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index 1b8cdd567..2b253dabf 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -1,4 +1,4 @@ -# gnulib-common.m4 serial 40 +# gnulib-common.m4 serial 41 dnl Copyright (C) 2007-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -16,12 +16,15 @@ AC_DEFUN([gl_COMMON], [ AC_DEFUN([gl_COMMON_BODY], [ AH_VERBATIM([_Noreturn], [/* The _Noreturn keyword of C11. */ -#if ! (defined _Noreturn \ - || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) -# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ - || 0x5110 <= __SUNPRO_C) +#ifndef _Noreturn +# if 201103 <= (defined __cplusplus ? __cplusplus : 0) +# define _Noreturn [[noreturn]] +# elif (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \ +|| 4 < __GNUC__ + (7 <= __GNUC_MINOR__)) + /* _Noreturn works as-is. */ +# elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C # define _Noreturn __attribute__ ((__noreturn__)) -# elif defined _MSC_VER && 1200 <= _MSC_VER +# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0) # define _Noreturn __declspec (noreturn) # else # define _Noreturn -- 2.19.1
Re: bison-3.2 make fails on Solaris 11.3 x86/64
Hi Akim, make check passed. Regards, --- Kiyoshi - Original Message - > From: Akim Demaille > To: Kiyoshi KANAZAWA > Cc: Paul Eggert ; Bison Bugs > Date: 2018/10/31, Wed 20:49 > Subject: Re: bison-3.2 make fails on Solaris 11.3 x86/64 > > > >> Le 31 oct. 2018 à 10:30, Kiyoshi KANAZAWA > a écrit : >> >> Hi, >> >> make test still fails. > > Yes, of course. Sorry about that. > > https://www.lrde.epita.fr/~akim/private/bison/bison-3.2.6-f8cad.tar.gz > https://www.lrde.epita.fr/~akim/private/bison/bison-3.2.6-f8cad.tar.zz > > commit f8cadc731b0df0df9e93d009d5e96b0f752a9b3c > Author: Akim Demaille > Date: Wed Oct 31 09:25:04 2018 +0100 > > c: provide a definition of _Noreturn that works for C++ > > On Solaris, GCC 7.3 defines: > > -std=c++14 -std=c++17 > __cplusplus 201402L 201703L > __STDC_VERSION__ 199901L 201112L > > So the current #definition of _Noreturn sees that 201112 <= > __STDC_VERSION__, i.e., that C11 is supported, so it expects _Noreturn > to be supported. Apparently it is not. > > This is only for C++, the test suite works for C. However, the test > suite does not try several C standards, maybe we should... > > http://lists.gnu.org/archive/html/bug-bison/2018-10/msg00064.html > > * data/c.m4 (b4_attribute_define): Define _Noreturn as [[noreturn]] in > modern C++. > > diff --git a/data/c.m4 b/data/c.m4 > index 04df3ffc..bb19b348 100644 > --- a/data/c.m4 > +++ b/data/c.m4 > @@ -228,15 +228,18 @@ m4_define([b4_attribute_define], > #endif > > ]m4_bmatch([$1], [\bnoreturn\b], [[/* The _Noreturn keyword of C11. */ > -#if ! (defined _Noreturn \ > - || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) > -# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) > \ > - || 0x5110 <= __SUNPRO_C) > -# define _Noreturn __attribute__ ((__noreturn__)) > -# elif defined _MSC_VER && 1200 <= _MSC_VER > -# define _Noreturn __declspec (noreturn) > -# else > -# define _Noreturn > +#if ! defined _Noreturn > +# if defined __cplusplus && 201103L <= __cplusplus > +# define _Noreturn [[noreturn]] > +# elif !(defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__) > +# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) > \ > + || 0x5110 <= __SUNPRO_C) > +# define _Noreturn __attribute__ ((__noreturn__)) > +# elif defined _MSC_VER && 1200 <= _MSC_VER > +# define _Noreturn __declspec (noreturn) > +# else > +# define _Noreturn > +# endif > # endif > #endif >
Re: bison-3.2 make fails on Solaris 11.3 x86/64
> Le 31 oct. 2018 à 10:30, Kiyoshi KANAZAWA a > écrit : > > Hi, > > make test still fails. Yes, of course. Sorry about that. https://www.lrde.epita.fr/~akim/private/bison/bison-3.2.6-f8cad.tar.gz https://www.lrde.epita.fr/~akim/private/bison/bison-3.2.6-f8cad.tar.zz commit f8cadc731b0df0df9e93d009d5e96b0f752a9b3c Author: Akim Demaille Date: Wed Oct 31 09:25:04 2018 +0100 c: provide a definition of _Noreturn that works for C++ On Solaris, GCC 7.3 defines: -std=c++14 -std=c++17 __cplusplus 201402L 201703L __STDC_VERSION__ 199901L 201112L So the current #definition of _Noreturn sees that 201112 <= __STDC_VERSION__, i.e., that C11 is supported, so it expects _Noreturn to be supported. Apparently it is not. This is only for C++, the test suite works for C. However, the test suite does not try several C standards, maybe we should... http://lists.gnu.org/archive/html/bug-bison/2018-10/msg00064.html * data/c.m4 (b4_attribute_define): Define _Noreturn as [[noreturn]] in modern C++. diff --git a/data/c.m4 b/data/c.m4 index 04df3ffc..bb19b348 100644 --- a/data/c.m4 +++ b/data/c.m4 @@ -228,15 +228,18 @@ m4_define([b4_attribute_define], #endif ]m4_bmatch([$1], [\bnoreturn\b], [[/* The _Noreturn keyword of C11. */ -#if ! (defined _Noreturn \ - || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) -# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ - || 0x5110 <= __SUNPRO_C) -# define _Noreturn __attribute__ ((__noreturn__)) -# elif defined _MSC_VER && 1200 <= _MSC_VER -# define _Noreturn __declspec (noreturn) -# else -# define _Noreturn +#if ! defined _Noreturn +# if defined __cplusplus && 201103L <= __cplusplus +# define _Noreturn [[noreturn]] +# elif !(defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__) +# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ + || 0x5110 <= __SUNPRO_C) +# define _Noreturn __attribute__ ((__noreturn__)) +# elif defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn +# endif # endif #endif
Re: bison-3.2 make fails on Solaris 11.3 x86/64
Hi, make test still fails. testsuite.log is attached. --- Kiyoshi - Original Message - > From: Akim Demaille > To: Kiyoshi KANAZAWA > Cc: Paul Eggert ; Bison Bugs > Date: 2018/10/31, Wed 17:49 > Subject: Re: bison-3.2 make fails on Solaris 11.3 x86/64 > > > >> Le 31 oct. 2018 à 09:15, Kiyoshi KANAZAWA > a écrit : >> >> Hi Akim, >> >> @@ -2130,8 +2130,8 @@ >> int main() >> { >> die(); >> - "201402L"; >> - "199901L"; >> + "201703L"; >> + "201112L"; > > good. > > > Let’s try this patch then. It should not have too much impact > on the common case of a C compiler. > > https://www.lrde.epita.fr/~akim/private/bison/bison-3.2.6-b8bb.tar.gz > https://www.lrde.epita.fr/~akim/private/bison/bison-3.2.6-b8bb.tar.xz > > commit b8bb6edc84465cca7474b6e0e95d1977f19bb0cf > Author: Akim Demaille > Date: Wed Oct 31 09:25:04 2018 +0100 > > c: provide a definition of _Noreturn that works for C++ > > On Solaris, GCC 7.3 defines: > > -std=c++14 -std=c++17 > __cplusplus 201402L 201703L > __STDC_VERSION__ 199901L 201112L > > So the current #definition of _Noreturn sees that 201112 <= > __STDC_VERSION__, i.e., that C11 is supported, so it expects _Noreturn > to be supported. Apparently it is not. > > This is only for C++, the test suite works for C. However, the test > suite does not try several C standards, maybe we should... > > http://lists.gnu.org/archive/html/bug-bison/2018-10/msg00064.html > > * data/c.m4 (b4_attribute_define): Define _Noreturn as [[noreturn]] in > modern C++. > > diff --git a/data/c.m4 b/data/c.m4 > index 04df3ffc..77900e6d 100644 > --- a/data/c.m4 > +++ b/data/c.m4 > @@ -230,7 +230,9 @@ m4_define([b4_attribute_define], > ]m4_bmatch([$1], [\bnoreturn\b], [[/* The _Noreturn keyword of C11. */ > #if ! (defined _Noreturn \ > || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) > -# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) > \ > +# if defined __cplusplus && 201103L <= __cplusplus > +# define _Noreturn [[noreturn]] > +# elif (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) > \ > || 0x5110 <= __SUNPRO_C) > # define _Noreturn __attribute__ ((__noreturn__)) > # elif defined _MSC_VER && 1200 <= _MSC_VER > testsuite.log.xz Description: Binary data
Re: bison-3.2 make fails on Solaris 11.3 x86/64
> Le 31 oct. 2018 à 09:15, Kiyoshi KANAZAWA a > écrit : > > Hi Akim, > > @@ -2130,8 +2130,8 @@ > int main() > { >die(); > - "201402L"; > - "199901L"; > + "201703L"; > + "201112L"; good. Let’s try this patch then. It should not have too much impact on the common case of a C compiler. https://www.lrde.epita.fr/~akim/private/bison/bison-3.2.6-b8bb.tar.gz https://www.lrde.epita.fr/~akim/private/bison/bison-3.2.6-b8bb.tar.xz commit b8bb6edc84465cca7474b6e0e95d1977f19bb0cf Author: Akim Demaille Date: Wed Oct 31 09:25:04 2018 +0100 c: provide a definition of _Noreturn that works for C++ On Solaris, GCC 7.3 defines: -std=c++14 -std=c++17 __cplusplus 201402L 201703L __STDC_VERSION__ 199901L 201112L So the current #definition of _Noreturn sees that 201112 <= __STDC_VERSION__, i.e., that C11 is supported, so it expects _Noreturn to be supported. Apparently it is not. This is only for C++, the test suite works for C. However, the test suite does not try several C standards, maybe we should... http://lists.gnu.org/archive/html/bug-bison/2018-10/msg00064.html * data/c.m4 (b4_attribute_define): Define _Noreturn as [[noreturn]] in modern C++. diff --git a/data/c.m4 b/data/c.m4 index 04df3ffc..77900e6d 100644 --- a/data/c.m4 +++ b/data/c.m4 @@ -230,7 +230,9 @@ m4_define([b4_attribute_define], ]m4_bmatch([$1], [\bnoreturn\b], [[/* The _Noreturn keyword of C11. */ #if ! (defined _Noreturn \ || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) -# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ +# if defined __cplusplus && 201103L <= __cplusplus +# define _Noreturn [[noreturn]] +# elif (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ || 0x5110 <= __SUNPRO_C) # define _Noreturn __attribute__ ((__noreturn__)) # elif defined _MSC_VER && 1200 <= _MSC_VER
Re: bison-3.2 make fails on Solaris 11.3 x86/64
Hi Akim, Yes, -std=c++17 seems to be only supported as c++1z, highly experimental. % g++ --version g++ (GCC) 7.3.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. % diff -u /tmp/14.ii /tmp/17.ii --- /tmp/14.ii 2018-10-31 16:56:58.187733403 + +++ /tmp/17.ii 2018-10-31 16:57:03.879568918 + @@ -2122,7 +2122,7 @@ using ::__gnu_cxx::strtold; } } -__attribute__ ((__noreturn__)) +_Noreturn static void die() { abort(); @@ -2130,8 +2130,8 @@ int main() { die(); - "201402L"; - "199901L"; + "201703L"; + "201112L"; "__SUNPRO_C"; "7"; "3"; % g++ /tmp/foo.cc -Wall -E -P -std=c++17 | tail -20 using ::__gnu_cxx::strtof; using ::__gnu_cxx::strtoll; using ::__gnu_cxx::strtoull; using ::__gnu_cxx::strtold; } } _Noreturn static void die() { abort(); } int main() { die(); "201703L"; "201112L"; "__SUNPRO_C"; "7"; "3"; } Is this good information for you ? --- Kiyoshi - Original Message - > From: Akim Demaille > To: Kiyoshi KANAZAWA ; Paul Eggert > > Cc: Bison Bugs > Date: 2018/10/31, Wed 15:37 > Subject: Re: bison-3.2 make fails on Solaris 11.3 x86/64 > > Hi Kiyoshi, > > (Paul, that’s typically some area where your expertise would be > most helpful). > >> Le 31 oct. 2018 à 00:03, Kiyoshi KANAZAWA > a écrit : >> >> Hello, >> >> What I did are: >> % ./configure --prefix=/opt/local --disable-nls CC=gcc CXX=g++ >> (GNU softwares are installed on /opt/local) >> % make >> % make -k check >> >> Also did the same with bison-3.1, because I remember >> >>>> 479: C++ GLR parser identifier shadowing FAILED > (c++.at:1332) >> >> was not found with it. >> >> testsuite.log of both are attached. > > Thanks a lot. Bison 3.1 did not have this test, that’s why it > passed (well, rather the test is now more complete: before we > were not trying several C++ standards). > > The failure is: > > ./c++.at:1332: $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS > stderr: > input.cc:841:8: error: '_Noreturn' does not name a type > static _Noreturn void > ^ > input.cc:849:8: error: '_Noreturn' does not name a type > static _Noreturn void > ^ > > > So the core of your problem is this (/tmp/foo.cc): > > #include > > #define STRINGIZE_(S) #S > #define STRINGIZE(S) STRINGIZE_(S) > #undef _Noreturn > > /* The _Noreturn keyword of C11. */ > #if ! (defined _Noreturn \ > || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) > # if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) > \ > || 0x5110 <= __SUNPRO_C) > # define _Noreturn __attribute__ ((__noreturn__)) > # elif defined _MSC_VER && 1200 <= _MSC_VER > # define _Noreturn __declspec (noreturn) > # else > # define _Noreturn > # endif > #endif > > _Noreturn > static void die() > { > abort(); > } > > int main() > { > die(); > STRINGIZE(__cplusplus); > STRINGIZE(__STDC_VERSION__); > STRINGIZE(__SUNPRO_C); > STRINGIZE(__GNUC__); > STRINGIZE(__GNUC_MINOR__); > } > > > Your C++ compiler behaves as expected for ‘-std=c++98’, ‘-std=c++03’, > ‘-std=c++11’, ‘-std=c++14’, but not for ‘-std=c++17’. > > I need your help to see what it needs. > > What I don’t understand is that your C++ compiler appears to be GCC. > > | configure:5994: checking for C++ compiler version > | configure:6003: g++ --version >&5 > | g++ (GCC) 7.3.0 > | Copyright (C) 2017 Free Software Foundation, Inc. > | This is free software; see the source for copying conditions. There is NO > | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > | > | configure:6014: $? = 0 > > > > configure did notice that ‘-std=c++98’, ‘-std=c++03’, ‘-std=c++11’, > ‘-std=c++14’, *and* ‘-std=c++17’ are supported, but not 2a, which > is fine. > > > Please, try this: > 1. put the program above in some file, say /tmp/foo.cc > 2. run g++ /tmp/foo.cc -Wall -E -P -std=c++14 > /tmp/14.ii > 3. run g++ /tmp/foo.cc -Wall -E -P -std=c++17 > /tmp/17.ii > 4. show me the diff -u /tmp/14.ii /tmp/17.ii > 5. and show me > g++ /tmp/foo.cc -Wall -E -P -std=c++17 | tail -20 > > Maybe you’ll see what is needed: we need to understand what changes > with -std=c++17 that results in _Noreturn not being defined at all. > > Also, pay attention that in the case of the test case itself > (in the Bison test suite), config.h might shadow what we do about > _Noreturn. > > Eventually we shall use [[noreturn]] in C++11 onwards, but first, > let’s see what’s happening here. >
Re: bison-3.2 make fails on Solaris 11.3 x86/64
Hi Kiyoshi, (Paul, that’s typically some area where your expertise would be most helpful). > Le 31 oct. 2018 à 00:03, Kiyoshi KANAZAWA a > écrit : > > Hello, > > What I did are: > % ./configure --prefix=/opt/local --disable-nls CC=gcc CXX=g++ > (GNU softwares are installed on /opt/local) > % make > % make -k check > > Also did the same with bison-3.1, because I remember > >>> 479: C++ GLR parser identifier shadowing FAILED (c++.at:1332) > > was not found with it. > > testsuite.log of both are attached. Thanks a lot. Bison 3.1 did not have this test, that’s why it passed (well, rather the test is now more complete: before we were not trying several C++ standards). The failure is: ./c++.at:1332: $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS stderr: input.cc:841:8: error: '_Noreturn' does not name a type static _Noreturn void ^ input.cc:849:8: error: '_Noreturn' does not name a type static _Noreturn void ^ So the core of your problem is this (/tmp/foo.cc): #include #define STRINGIZE_(S) #S #define STRINGIZE(S) STRINGIZE_(S) #undef _Noreturn /* The _Noreturn keyword of C11. */ #if ! (defined _Noreturn \ || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) # if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \ || 0x5110 <= __SUNPRO_C) # define _Noreturn __attribute__ ((__noreturn__)) # elif defined _MSC_VER && 1200 <= _MSC_VER # define _Noreturn __declspec (noreturn) # else # define _Noreturn # endif #endif _Noreturn static void die() { abort(); } int main() { die(); STRINGIZE(__cplusplus); STRINGIZE(__STDC_VERSION__); STRINGIZE(__SUNPRO_C); STRINGIZE(__GNUC__); STRINGIZE(__GNUC_MINOR__); } Your C++ compiler behaves as expected for ‘-std=c++98’, ‘-std=c++03’, ‘-std=c++11’, ‘-std=c++14’, but not for ‘-std=c++17’. I need your help to see what it needs. What I don’t understand is that your C++ compiler appears to be GCC. | configure:5994: checking for C++ compiler version | configure:6003: g++ --version >&5 | g++ (GCC) 7.3.0 | Copyright (C) 2017 Free Software Foundation, Inc. | This is free software; see the source for copying conditions. There is NO | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | | configure:6014: $? = 0 configure did notice that ‘-std=c++98’, ‘-std=c++03’, ‘-std=c++11’, ‘-std=c++14’, *and* ‘-std=c++17’ are supported, but not 2a, which is fine. Please, try this: 1. put the program above in some file, say /tmp/foo.cc 2. run g++ /tmp/foo.cc -Wall -E -P -std=c++14 > /tmp/14.ii 3. run g++ /tmp/foo.cc -Wall -E -P -std=c++17 > /tmp/17.ii 4. show me the diff -u /tmp/14.ii /tmp/17.ii 5. and show me g++ /tmp/foo.cc -Wall -E -P -std=c++17 | tail -20 Maybe you’ll see what is needed: we need to understand what changes with -std=c++17 that results in _Noreturn not being defined at all. Also, pay attention that in the case of the test case itself (in the Bison test suite), config.h might shadow what we do about _Noreturn. Eventually we shall use [[noreturn]] in C++11 onwards, but first, let’s see what’s happening here.
Re: bison-3.2 make fails on Solaris 11.3 x86/64
Hello, What I did are: % ./configure --prefix=/opt/local --disable-nls CC=gcc CXX=g++ (GNU softwares are installed on /opt/local) % make % make -k check Also did the same with bison-3.1, because I remember >> 479: C++ GLR parser identifier shadowing FAILED (c++.at:1332) was not found with it. testsuite.log of both are attached. Regards, --- Kiyoshi - Original Message - > From: Akim Demaille > To: Kiyoshi KANAZAWA > Cc: Bison Bugs ; Bison Patches > Date: 2018/10/31, Wed 03:57 > Subject: Re: bison-3.2 make fails on Solaris 11.3 x86/64 > > > >> Le 30 oct. 2018 à 09:49, Kiyoshi KANAZAWA > a écrit : >> >> Hello, >> >> make passed with bison-3.2.3-5d07f. >> >> 479: C++ GLR parser identifier shadowing FAILED (c++.at:1332) > > This is: > >> # -*- compilation -*- >> 479. c++.at:1293: testing C++ GLR parser identifier shadowing ... >> ./c++.at:1331: bison -fno-caret -o input.cc input.yy >> Testing with C++ standard flags: '' >> ./c++.at:1332: $BISON_CXX_WORKS >> stderr: >> stdout: >> ./c++.at:1332: $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS >> stderr: >> stdout: >> Testing with C++ standard flags: '-std=c++98' >> ./c++.at:1332: $BISON_CXX_WORKS >> stderr: >> stdout: >> ./c++.at:1332: $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS >> stderr: >> stdout: >> Testing with C++ standard flags: '-std=c++03' >> ./c++.at:1332: $BISON_CXX_WORKS >> stderr: >> stdout: >> ./c++.at:1332: $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS >> stderr: >> stdout: >> Testing with C++ standard flags: '-std=c++11' >> ./c++.at:1332: $BISON_CXX_WORKS >> stderr: >> stdout: >> ./c++.at:1332: $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS >> stderr: >> stdout: >> Testing with C++ standard flags: '-std=c++14' >> ./c++.at:1332: $BISON_CXX_WORKS >> stderr: >> stdout: >> ./c++.at:1332: $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS >> stderr: >> stdout: >> Testing with C++ standard flags: '-std=c++17' >> ./c++.at:1332: $BISON_CXX_WORKS >> stderr: >> stdout: >> ./c++.at:1332: $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS >> stderr: >> input.cc:837:8: error: '_Noreturn' does not name a type >> static _Noreturn void >> ^ >> input.cc:845:8: error: '_Noreturn' does not name a type >> static _Noreturn void >> ^ >> input.cc: In function 'void yyexpandGLRStack(yyGLRStack*)': >> input.cc:1226:5: error: 'yyMemoryExhausted' was not declared in > this scope >> yyMemoryExhausted (yystackp); >> ^ >> input.cc:1232:5: error: 'yyMemoryExhausted' was not declared in > this scope >> yyMemoryExhausted (yystackp); >> ^ >> input.cc: In function 'std::size_t yysplitStack(yyGLRStack*, > std::size_t)': >> input.cc:1568:9: error: 'yyMemoryExhausted' was not declared in > this scope >> yyMemoryExhausted (yystackp); >> ^ >> input.cc:1576:9: error: 'yyMemoryExhausted' was not declared in > this scope >> yyMemoryExhausted (yystackp); >> ^ >> input.cc:1584:9: error: 'yyMemoryExhausted' was not declared in > this scope >> yyMemoryExhausted (yystackp); >> ^ >> input.cc: In function 'void yyrecoverSyntaxError(yyGLRStack*, > yy::parser&)': >> input.cc:2225:11: error: 'yyFail' was not declared in this scope >> yyFail (yystackp, yyparser, YY_NULLPTR); >> ^~ >> input.cc:2225:11: note: suggested alternative: 'yyfill' >> yyFail (yystackp, yyparser, YY_NULLPTR); >> ^~ >> yyfill >> input.cc:2262:5: error: 'yyFail' was not declared in this scope >> yyFail (yystackp, yyparser, YY_NULLPTR); >> ^~ >> input.cc:2262:5: note: suggested alternative: 'yyfill' >> yyFail (yystackp, yyparser, YY_NULLPTR); >> ^~ >> yyfill >> input.cc:2296:5: error: 'yyFail' was not declared in this scope >> yyFail (yystackp, yyparser, YY_NULLPTR); >> ^~ >> input.cc:2296:5: note: suggested alternative: 'yyfill' >> yyFail (yystackp, yyparser, YY_NULLPTR); >> ^~ >> yyfill
Re: bison-3.2 make fails on Solaris 11.3 x86/64
Hi, I should have told you about the locale. Very limited locale is installed on my system: % locale -a C POSIX en_US.ISO8859-1 en_US.ISO8859-15 en_US.ISO8859-15@euro en_US.UTF-8 ja_JP.PCK ja_JP.UTF-8 ja_JP.UTF-8@cldr ja_JP.eucJP So, I usually use % ./configure --disable-nls Will check again after reading another email from you. --- Kiyoshi - Original Message - > From: Akim Demaille > To: Kiyoshi KANAZAWA > Cc: Bison Bugs ; Bison Patches > Date: 2018/10/31, Wed 03:51 > Subject: Re: bison-3.2 make fails on Solaris 11.3 x86/64 > > Hi! > >> Le 30 oct. 2018 à 09:49, Kiyoshi KANAZAWA > a écrit : >> >> Hello, >> >> make passed with bison-3.2.3-5d07f. >> >> But, make check fails as >> FAIL: examples/calc++/calc++.test >> 479: C++ GLR parser identifier shadowing FAILED (c++.at:1332) >> >> >> calc++.log & 479/testsuite.log are attached. > > Please, next time send tests/testsuite.log, like the final message of > the testsuite asks. It will save mails exchanges to get details > about your environment. > > Your calc++.log contains: > > ./examples/test[97]: .[64]: local: not found [No such file or directory] > ./examples/test[97]: .[70]: local: not found [No such file or directory] > ./examples/test[97]: .[73]: local: not found [No such file or directory] > ./examples/test[97]: .[76]: local: not found [No such file or directory] > ./examples/test[97]: .[79]: local: not found [No such file or directory] > calc++: PASS: 1 > > so I will install this: > > commit ca8039e61279fcb1d15ae5333ef9007db85fd870 > Author: Akim Demaille > Date: Tue Oct 30 19:04:31 2018 +0100 > > tests: don't expect the shell to support 'local' > > It doesn't work on Solaris 11.3 x86/64. > Reported by Kiyoshi Kanazawa. > http://lists.gnu.org/archive/html/bug-bison/2018-10/msg00051.html > > * examples/test: Don't use 'local'. > > diff --git a/examples/test b/examples/test > index 251307b0..96db4e7f 100755 > --- a/examples/test > +++ b/examples/test > @@ -45,7 +45,7 @@ fi > # --- > cleanup () > { > - local status=$? > + status=$? > if test -z "$DEBUG"; then > cd $cwd > rm -rf $$.dir > @@ -61,22 +61,22 @@ cd $$.dir > # -noerr: ignore stderr, otherwise merge it into effective output. > run () > { > - local noerr=false > + noerr=false > case $1 in > (-noerr) noerr=true; shift;; > esac > > # Expected exit status. > - local sta_exp="$1" > + sta_exp=$1 > shift > # Expected output. > - local out_exp="$1" > + out_exp=$1 > shift > # Effective exit status. > - local sta_eff=0 > + sta_eff=0 > $prog "$@" - out_eff 2>err_eff || sta_eff=$? > # Combine effective output and error streams. > - local out_eff="$(cat out_eff && $noerr || sed -e 's/^/err: > /g' err_eff)" > + out_eff=$(cat out_eff && $noerr || sed -e 's/^/err: /g' > err_eff) > if test $sta_eff -eq $sta_exp; then > if test "$out_eff" = "$out_exp"; then > echo "$me: PASS: $number" >
Re: bison-3.2 make fails on Solaris 11.3 x86/64
> Le 30 oct. 2018 à 09:49, Kiyoshi KANAZAWA a > écrit : > > Hello, > > make passed with bison-3.2.3-5d07f. > > 479: C++ GLR parser identifier shadowing FAILED (c++.at:1332) This is: > # -*- compilation -*- > 479. c++.at:1293: testing C++ GLR parser identifier shadowing ... > ./c++.at:1331: bison -fno-caret -o input.cc input.yy > Testing with C++ standard flags: '' > ./c++.at:1332: $BISON_CXX_WORKS > stderr: > stdout: > ./c++.at:1332: $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS > stderr: > stdout: > Testing with C++ standard flags: '-std=c++98' > ./c++.at:1332: $BISON_CXX_WORKS > stderr: > stdout: > ./c++.at:1332: $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS > stderr: > stdout: > Testing with C++ standard flags: '-std=c++03' > ./c++.at:1332: $BISON_CXX_WORKS > stderr: > stdout: > ./c++.at:1332: $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS > stderr: > stdout: > Testing with C++ standard flags: '-std=c++11' > ./c++.at:1332: $BISON_CXX_WORKS > stderr: > stdout: > ./c++.at:1332: $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS > stderr: > stdout: > Testing with C++ standard flags: '-std=c++14' > ./c++.at:1332: $BISON_CXX_WORKS > stderr: > stdout: > ./c++.at:1332: $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS > stderr: > stdout: > Testing with C++ standard flags: '-std=c++17' > ./c++.at:1332: $BISON_CXX_WORKS > stderr: > stdout: > ./c++.at:1332: $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS > stderr: > input.cc:837:8: error: '_Noreturn' does not name a type > static _Noreturn void > ^ > input.cc:845:8: error: '_Noreturn' does not name a type > static _Noreturn void > ^ > input.cc: In function 'void yyexpandGLRStack(yyGLRStack*)': > input.cc:1226:5: error: 'yyMemoryExhausted' was not declared in this scope > yyMemoryExhausted (yystackp); > ^ > input.cc:1232:5: error: 'yyMemoryExhausted' was not declared in this scope > yyMemoryExhausted (yystackp); > ^ > input.cc: In function 'std::size_t yysplitStack(yyGLRStack*, std::size_t)': > input.cc:1568:9: error: 'yyMemoryExhausted' was not declared in this scope > yyMemoryExhausted (yystackp); > ^ > input.cc:1576:9: error: 'yyMemoryExhausted' was not declared in this scope > yyMemoryExhausted (yystackp); > ^ > input.cc:1584:9: error: 'yyMemoryExhausted' was not declared in this scope > yyMemoryExhausted (yystackp); > ^ > input.cc: In function 'void yyrecoverSyntaxError(yyGLRStack*, yy::parser&)': > input.cc:2225:11: error: 'yyFail' was not declared in this scope >yyFail (yystackp, yyparser, YY_NULLPTR); >^~ > input.cc:2225:11: note: suggested alternative: 'yyfill' >yyFail (yystackp, yyparser, YY_NULLPTR); >^~ >yyfill > input.cc:2262:5: error: 'yyFail' was not declared in this scope > yyFail (yystackp, yyparser, YY_NULLPTR); > ^~ > input.cc:2262:5: note: suggested alternative: 'yyfill' > yyFail (yystackp, yyparser, YY_NULLPTR); > ^~ > yyfill > input.cc:2296:5: error: 'yyFail' was not declared in this scope > yyFail (yystackp, yyparser, YY_NULLPTR); > ^~ > input.cc:2296:5: note: suggested alternative: 'yyfill' > yyFail (yystackp, yyparser, YY_NULLPTR); > ^~ > yyfill > input.cc: In function 'int yyparse(yy::parser&)': > input.cc:2446:17: error: 'yyFail' was not declared in this scope > yyFail (, yyparser, YY_("syntax error")); > ^~ > input.cc:2446:17: note: suggested alternative: 'yyfill' > yyFail (, yyparser, YY_("syntax error")); > ^~ > yyfill > stdout: > ./c++.at:1332: exit code was 1, expected 0 > 479. c++.at:1293: 479. C++ GLR parser identifier shadowing (c++.at:1293): > FAILED (c++.at:1332) So I propose the patch below. Here, the real testsuite.log would probably have been useful. Please report the result on this tarball: https://www.lrde.epita.fr/~akim/private/bison/bison-3.2.5-bd7ae.tar.gz https://www.lrde.epita.fr/~akim/private/bison/bison-3.2.5-bd7ae.tar.xz Thanks in advance. commit bd7aebb8b002f0706bfa771f22c01f243fa7fbcf Author: Akim Demaille Date: Tue Oct 30 19:09:46 2018 +0100 c: update the definition of _Noreturn Does not work on Solaris 11.3 x86/64: 479. c++.at:1293: testing C++ GLR parser identifier shadowing ... Testing with C++ standard flags: '-std=c++17' ./c++.at:1332: $BISON_CXX_WORKS stderr: stdout: ./c++.at:1332: $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS stderr: input.cc:837:8: error: '_Noreturn' does not name a type static _Noreturn
Re: bison-3.2 make fails on Solaris 11.3 x86/64
Hi! > Le 30 oct. 2018 à 09:49, Kiyoshi KANAZAWA a > écrit : > > Hello, > > make passed with bison-3.2.3-5d07f. > > But, make check fails as > FAIL: examples/calc++/calc++.test > 479: C++ GLR parser identifier shadowing FAILED (c++.at:1332) > > > calc++.log & 479/testsuite.log are attached. Please, next time send tests/testsuite.log, like the final message of the testsuite asks. It will save mails exchanges to get details about your environment. Your calc++.log contains: ./examples/test[97]: .[64]: local: not found [No such file or directory] ./examples/test[97]: .[70]: local: not found [No such file or directory] ./examples/test[97]: .[73]: local: not found [No such file or directory] ./examples/test[97]: .[76]: local: not found [No such file or directory] ./examples/test[97]: .[79]: local: not found [No such file or directory] calc++: PASS: 1 so I will install this: commit ca8039e61279fcb1d15ae5333ef9007db85fd870 Author: Akim Demaille Date: Tue Oct 30 19:04:31 2018 +0100 tests: don't expect the shell to support 'local' It doesn't work on Solaris 11.3 x86/64. Reported by Kiyoshi Kanazawa. http://lists.gnu.org/archive/html/bug-bison/2018-10/msg00051.html * examples/test: Don't use 'local'. diff --git a/examples/test b/examples/test index 251307b0..96db4e7f 100755 --- a/examples/test +++ b/examples/test @@ -45,7 +45,7 @@ fi # --- cleanup () { - local status=$? + status=$? if test -z "$DEBUG"; then cd $cwd rm -rf $$.dir @@ -61,22 +61,22 @@ cd $$.dir # -noerr: ignore stderr, otherwise merge it into effective output. run () { - local noerr=false + noerr=false case $1 in (-noerr) noerr=true; shift;; esac # Expected exit status. - local sta_exp="$1" + sta_exp=$1 shift # Expected output. - local out_exp="$1" + out_exp=$1 shift # Effective exit status. - local sta_eff=0 + sta_eff=0 $prog "$@" - out_eff 2>err_eff || sta_eff=$? # Combine effective output and error streams. - local out_eff="$(cat out_eff && $noerr || sed -e 's/^/err: /g' err_eff)" + out_eff=$(cat out_eff && $noerr || sed -e 's/^/err: /g' err_eff) if test $sta_eff -eq $sta_exp; then if test "$out_eff" = "$out_exp"; then echo "$me: PASS: $number"
Re: bison-3.2 make fails on Solaris 11.3 x86/64
Hello, make passed with bison-3.2.3-5d07f. But, make check fails as FAIL: examples/calc++/calc++.test 479: C++ GLR parser identifier shadowing FAILED (c++.at:1332) calc++.log & 479/testsuite.log are attached. Regards, --- Kiyoshi - Original Message - > From: Akim Demaille > To: Kiyoshi KANAZAWA > Cc: Bison Bugs ; Bison Patches > Date: 2018/10/30, Tue 15:31 > Subject: Re: bison-3.2 make fails on Solaris 11.3 x86/64 > > > >> Le 30 oct. 2018 à 02:25, Kiyoshi KANAZAWA > a écrit : >> >> Hello, >> Trying to build bison-3.2 on Solaris 11.3 x86/64, but failed. >> >> % uname -a >> SunOS 5.11 11.3 i86pc i386 i86pc >> >> % gcc --version >> gcc (GCC) 7.3.0 >> % ar --version >> GNU ar (GNU Binutils) 2.31.1 >> >> >> >> % ./configure CC=gcc >> % make >> : >> CC lib/vsprintf.o >> CC lib/xmemdup0.o >> AR lib/libbison.a > > Bummer… > > I have installed the following patch. Could you please try this tarball? > Thanks in advance. > > https://www.lrde.epita.fr/~akim/private/bison/bison-3.2.3-5d07f.tar.gz > https://www.lrde.epita.fr/~akim/private/bison/bison-3.2.3-5d07f.tar.xz > > > commit e605ad9679b583bf7e09afe00daf23e0dfa6c823 > Author: Akim Demaille > Date: Tue Oct 30 06:55:47 2018 +0100 > > build: fix use of gnulib Make variables > > Reported by Kiyoshi Kanazawa. > http://lists.gnu.org/archive/html/bug-bison/2018-10/msg00048.html > > * lib/local.mk (lib_libbison_a_LIBADD): Merge into... > * src/local.mk (src_bison_LDADD): here. > > diff --git a/THANKS b/THANKS > index 3437e808..7254bb3f 100644 > --- a/THANKS > +++ b/THANKS > @@ -84,6 +84,7 @@ Juan Manuel Guerrero juan.guerr...@gmx.de > Kees Zeelenberg k...@users.sourceforge.net > Keith Browne kbro...@legato.com > Ken Moffat zarniwh...@ntlworld.com > +Kiyoshi Kanazawa yoi_no_myou...@yahoo.co.jp > Laurent Mascherpa laurent.masche...@epita.fr > Lie Yan lie@kaust.edu.sa > Magnus Fromreide ma...@lysator.liu.se > diff --git a/lib/local.mk b/lib/local.mk > index aec635a8..18c0953d 100644 > --- a/lib/local.mk > +++ b/lib/local.mk > @@ -45,15 +45,6 @@ lib_libbison_a_SOURCES += \ > lib/path-join.h \ > lib/path-join.c > > -lib_libbison_a_LIBADD += \ > - $(ISNAND_LIBM) \ > - $(ISNANF_LIBM) \ > - $(ISNANL_LIBM) \ > - $(LDEXPL_LIBM) \ > - $(LDEXP_LIBM) \ > - $(LIB_CLOCK_GETTIME) \ > - $(LIB_GETHRXTIME) > - > # The Yacc compatibility library. > if ENABLE_YACC > lib_LIBRARIES = lib/liby.a > diff --git a/src/local.mk b/src/local.mk > index 0651aac1..6d5adfd9 100644 > --- a/src/local.mk > +++ b/src/local.mk > @@ -104,9 +104,19 @@ BUILT_SOURCES += \ > src/scan-gram.c \ > src/scan-skel.c > > +# Although conceptually most of these guys would make more sense in the > +# definition of libbison, beware that they might expand as flags such as > +# `-lm`. Keep them here. Or use a Libtool convenience library. > src_bison_LDADD = \ > + $(ISNAND_LIBM) \ > + $(ISNANF_LIBM) \ > + $(ISNANL_LIBM) \ > + $(LDEXPL_LIBM) \ > + $(LDEXP_LIBM) \ > $(LIBINTL) \ > $(LIBTHREAD) \ > + $(LIB_CLOCK_GETTIME) \ > + $(LIB_GETHRXTIME) \ > lib/libbison.a > calc++.log.xz Description: Binary data 479_testsuite.log.xz Description: Binary data
Re: bison-3.2 make fails on Solaris 11.3 x86/64
> Le 30 oct. 2018 à 02:25, Kiyoshi KANAZAWA a > écrit : > > Hello, > Trying to build bison-3.2 on Solaris 11.3 x86/64, but failed. > > % uname -a > SunOS 5.11 11.3 i86pc i386 i86pc > > % gcc --version > gcc (GCC) 7.3.0 > % ar --version > GNU ar (GNU Binutils) 2.31.1 > > > > % ./configure CC=gcc > % make > : > CC lib/vsprintf.o > CC lib/xmemdup0.o > AR lib/libbison.a Bummer… I have installed the following patch. Could you please try this tarball? Thanks in advance. https://www.lrde.epita.fr/~akim/private/bison/bison-3.2.3-5d07f.tar.gz https://www.lrde.epita.fr/~akim/private/bison/bison-3.2.3-5d07f.tar.xz commit e605ad9679b583bf7e09afe00daf23e0dfa6c823 Author: Akim Demaille Date: Tue Oct 30 06:55:47 2018 +0100 build: fix use of gnulib Make variables Reported by Kiyoshi Kanazawa. http://lists.gnu.org/archive/html/bug-bison/2018-10/msg00048.html * lib/local.mk (lib_libbison_a_LIBADD): Merge into... * src/local.mk (src_bison_LDADD): here. diff --git a/THANKS b/THANKS index 3437e808..7254bb3f 100644 --- a/THANKS +++ b/THANKS @@ -84,6 +84,7 @@ Juan Manuel Guerrero juan.guerr...@gmx.de Kees Zeelenberg k...@users.sourceforge.net Keith Browne kbro...@legato.com Ken Moffatzarniwh...@ntlworld.com +Kiyoshi Kanazawa yoi_no_myou...@yahoo.co.jp Laurent Mascherpa laurent.masche...@epita.fr Lie Yan lie@kaust.edu.sa Magnus Fromreide ma...@lysator.liu.se diff --git a/lib/local.mk b/lib/local.mk index aec635a8..18c0953d 100644 --- a/lib/local.mk +++ b/lib/local.mk @@ -45,15 +45,6 @@ lib_libbison_a_SOURCES += \ lib/path-join.h \ lib/path-join.c -lib_libbison_a_LIBADD +=\ - $(ISNAND_LIBM)\ - $(ISNANF_LIBM)\ - $(ISNANL_LIBM)\ - $(LDEXPL_LIBM)\ - $(LDEXP_LIBM) \ - $(LIB_CLOCK_GETTIME) \ - $(LIB_GETHRXTIME) - # The Yacc compatibility library. if ENABLE_YACC lib_LIBRARIES = lib/liby.a diff --git a/src/local.mk b/src/local.mk index 0651aac1..6d5adfd9 100644 --- a/src/local.mk +++ b/src/local.mk @@ -104,9 +104,19 @@ BUILT_SOURCES +=\ src/scan-gram.c \ src/scan-skel.c +# Although conceptually most of these guys would make more sense in the +# definition of libbison, beware that they might expand as flags such as +# `-lm`. Keep them here. Or use a Libtool convenience library. src_bison_LDADD = \ + $(ISNAND_LIBM)\ + $(ISNANF_LIBM)\ + $(ISNANL_LIBM)\ + $(LDEXPL_LIBM)\ + $(LDEXP_LIBM) \ $(LIBINTL)\ $(LIBTHREAD) \ + $(LIB_CLOCK_GETTIME) \ + $(LIB_GETHRXTIME) \ lib/libbison.a