[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
yet another C++ implementation bug to work around in Bison
From: |
Paul Eggert |
Subject: |
yet another C++ implementation bug to work around in Bison |
Date: |
Thu, 02 Feb 2006 16:01:21 -0800 |
User-agent: |
Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) |
Nelson H. F. Beebe reported the following problem with Bison 2.1 on
when built on Solaris 7 with /usr/sfw/bin/gcc.
/usr/sfw/bin/g++ -I/usr/local/include -R/usr/local/lib -L/usr/local/lib -o
calc++ calc++-scanner.o calc++.o calc++-driver.o calc++-parser.o
Undefined first referenced
symbol in file
std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*,
std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)calc++-driver.o
std::_Rb_tree_decrement(std::_Rb_tree_node_base*)calc++-driver.o
This resembles the problem reported by Alen P. of the University of
Waterloo in
http://groups.google.com/group/uw.cs.cs454/msg/4428997110facb36
He gave the following method to reproduce the problem:
http://groups.google.com/group/uw.cs.cs454/msg/056fa89a6ac954de
and I used that idea in the patch shown below, which I installed.
This may not fix the bug, but it shouldn't hurt to filter out C++
implementations that can't do maps properly.
One possible, more drastic fix that comes to mind is that we should
not use C++ at all, as part of our normal build procedure. It often
causes build failures, and it's not really needed for Bison, so
perhaps the C++ stuff should all get moved to "make check".
2006-02-02 Paul Eggert <address@hidden>
More portability fixes for problems summarized by Nelson H. F. Beebe.
* m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
'#include <map>' works and that you can apply ++ to iterators.
--- cxx.m4 2 Feb 2006 07:33:13 -0000 1.6
+++ cxx.m4 2 Feb 2006 23:53:07 -0000 1.7
@@ -29,10 +29,18 @@ AC_DEFUN([BISON_TEST_FOR_WORKING_CXX_COM
[AC_LANG_PROGRAM(
[#include <cstdlib>
#include <iostream>
+ #include <map>
#include <string>
using namespace std;],
[std::cerr << "";
- cout << "";])],
+ cout << "";
+ typedef std::pair<unsigned int, int> uipair;
+ std::map<unsigned int, int> m;
+ std::map<unsigned int, int>::iterator i;
+ m.insert (uipair (4, -4));
+ for (i = m.begin (); i != m.end (); ++i)
+ if (i->first != 4)
+ return 1;])],
[bison_cv_cxx_works=yes],
[bison_cv_cxx_works=no],
[bison_cv_cxx_works=cross])
- yet another C++ implementation bug to work around in Bison,
Paul Eggert <=