bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cannot build bison-3.3.90 on Solaris 11.3: ‘to_string’ is not a memb


From: Akim Demaille
Subject: Re: cannot build bison-3.3.90 on Solaris 11.3: ‘to_string’ is not a member of ‘std’
Date: Mon, 20 May 2019 06:51:15 +0200

Hi Bruno!

> Le 19 mai 2019 à 22:23, Bruno Haible <address@hidden> a écrit :
> 
> The next problem during "make check" is a g++ compilation failure:
> 
>  CXX      examples/c++/variant_11-variant-11.o
> examples/c++/variant-11.cc: In member function ‘virtual int 
> yy::parser::parse()’:
> examples/c++/variant-11.cc:623:61: error: ‘to_string’ is not a member of ‘std’
>     { yylhs.value.as < string_uptr > () = make_string_uptr (std::to_string 
> (YY_MOVE (yystack_[0].value.as < int > ()))); }
>                                                             ^
> *** Error code 1
> The following command caused the error:
> echo "  CXX     " examples/c++/variant_11-variant-11.o;g++ -m64 -O2 
> -std=gnu++11 -DEXEEXT=\"\"   -I. -I/export/home/bruno/prefix64/include -Wall 
> -D_REENTRANT -std=c++11  -g -O2 -MT examples/c++/variant_11-variant-11.o -MD 
> -MP -MF examples/c++/.deps/variant_11-variant-11.Tpo -c -o 
> examples/c++/variant_11-variant-11.o `test -f 'examples/c++/variant-11.cc' || 
> echo './'`examples/c++/variant-11.cc
> make: Fatal error: Command failed for target 
> `examples/c++/variant_11-variant-11.o'
> Current working directory /export/home/bruno/bison-3.3.91.5-a1a84-dirty
> *** Error code 1
> 
> g++ is version 4.8.2.

That's a real portability issue: GCC 4.8 supports to_string on GNU/Linux.

How about this?  It's available as a tarball here:

https://www.lrde.epita.fr/~akim/private/bison/bison-3.4.7-9114b.tar.gz
https://www.lrde.epita.fr/~akim/private/bison/bison-3.4.7-9114b.tar.xz

Cheers!

commit 9114b267a8abbfa593848b3daa73aa72f65c8fbe
Author: Akim Demaille <address@hidden>
Date:   Mon May 20 06:27:55 2019 +0200

    c++: beware of to_string portability issues
    
    Reported by Bruno Haible.
    http://lists.gnu.org/archive/html/bug-bison/2019-05/msg00033.html
    
    * m4/bison-cxx-std.m4 (_BISON_CXXSTD_11_snippet): Check it.

diff --git a/m4/bison-cxx-std.m4 b/m4/bison-cxx-std.m4
index 1756c7d9..afef998a 100644
--- a/m4/bison-cxx-std.m4
+++ b/m4/bison-cxx-std.m4
@@ -63,6 +63,9 @@ m4_define([_BISON_CXXSTD_11_snippet],
     for (int r: std::set<int>{1, 2})
       continue;
   }
+
+  // GCC 4.8.2 on Solaris 11.3 does not support to_string.
+  auto e = std::to_string(42);
 ])
 
 m4_define([_BISON_CXXSTD_14_snippet],




reply via email to

[Prev in Thread] Current Thread [Next in Thread]