Robert P. J. DAY says:
apparently, the patchset for gcc 4.2.1 applies properly to the
source for gcc 4.2.2 and gcc 4.2.3. so, if you want, you can simply
add support for those last two just by augmenting menuconfig and
adding a couple symlinks for those two directories. seems like a
cheap way to add a couple new versions.
1 Workaround for buglet in std::vector etc. when compiling
2 with gcc-4.0.0 -Wall -O -fno-exceptions
5 .../include/c++/4.0.0/bits/vector.tcc: In member function 'void std::vector<_Tp,
6 _Alloc>::reserve(size_t) [with _Tp = int, _Alloc = std::allocator<int>]':
7 .../include/c++/4.0.0/bits/vector.tcc:78: warning: control may reach end of
8 non-void function 'typename _Alloc::pointer std::vector<_Tp,
9 _Alloc>::_M_allocate_and_copy(size_t, _ForwardIterator, _ForwardIterator) [with
10 _ForwardIterator = int*, _Tp = int, _Alloc = std::allocator<int>]' being inlined
12 See http://gcc.gnu.org/PR21951
14 --- gcc-4.0.1-20050607/libstdc++-v3/include/bits/stl_vector.h.old 2005-06-11 03:58:20.000000000 -0700
15 +++ gcc-4.0.1-20050607/libstdc++-v3/include/bits/stl_vector.h 2005-06-11 04:01:21.000000000 -0700
18 std::__uninitialized_copy_a(__first, __last, __result,
19 this->get_allocator());
24 _M_deallocate(__result, __n);
25 __throw_exception_again;
31 --- gcc-4.0.1-20050607/libstdc++-v3/include/bits/stl_uninitialized.h.old 2005-06-11 03:58:20.000000000 -0700
32 +++ gcc-4.0.1-20050607/libstdc++-v3/include/bits/stl_uninitialized.h 2005-06-11 04:05:18.990003248 -0700
35 for (; __first != __last; ++__first, ++__cur)
36 std::_Construct(&*__cur, *__first);
41 std::_Destroy(__result, __cur);
42 __throw_exception_again;
50 for (; __first != __last; ++__first, ++__cur)
51 __alloc.construct(&*__cur, *__first);
56 std::_Destroy(__result, __cur, __alloc);
57 __throw_exception_again;
62 template<typename _InputIterator, typename _ForwardIterator, typename _Tp>
65 return std::__uninitialized_copy_a(__first2, __last2, __mid, __alloc);
67 +#ifdef __EXCEPTIONS // work around http://gcc.gnu.org/PR21951 in gcc-4.0 only
70 std::_Destroy(__result, __mid, __alloc);
71 __throw_exception_again;
76 // __uninitialized_fill_copy
79 return std::__uninitialized_copy_a(__first, __last, __mid, __alloc);
81 +#ifdef __EXCEPTIONS // work around http://gcc.gnu.org/PR21951 in gcc-4.0 only
84 std::_Destroy(__result, __mid, __alloc);
85 __throw_exception_again;
90 // __uninitialized_copy_fill
91 --- gcc-4.0.1-20050607/libstdc++-v3/include/ext/rope.old 2005-06-11 03:58:20.000000000 -0700
92 +++ gcc-4.0.1-20050607/libstdc++-v3/include/ext/rope 2005-06-11 04:13:26.628870872 -0700
93 @@ -1645,11 +1645,13 @@
94 _S_cond_store_eos(__buf[__size]);
96 { return _S_new_RopeLeaf(__buf, __size, __a); }
97 +#ifdef __EXCEPTIONS // work around http://gcc.gnu.org/PR21951 in gcc-4.0 only
100 _RopeRep::__STL_FREE_STRING(__buf, __size, __a);
101 __throw_exception_again;
106 // Concatenation of nonempty strings.
107 --- gcc-4.0.1-20050607/libstdc++-v3/include/ext/memory.old 2005-06-11 03:58:20.000000000 -0700
108 +++ gcc-4.0.1-20050607/libstdc++-v3/include/ext/memory 2005-06-11 04:13:52.897877376 -0700
110 std::_Construct(&*__cur, *__first);
111 return pair<_InputIter, _ForwardIter>(__first, __cur);
113 +#ifdef __EXCEPTIONS // work around http://gcc.gnu.org/PR21951 in gcc-4.0 only
116 std::_Destroy(__result, __cur);
117 __throw_exception_again;
122 template<typename _RandomAccessIter, typename _Size, typename _ForwardIter>
123 @@ -144,11 +146,13 @@
124 __alloc.construct(&*__cur, *__first);
125 return pair<_InputIter, _ForwardIter>(__first, __cur);
127 +#ifdef __EXCEPTIONS // work around http://gcc.gnu.org/PR21951 in gcc-4.0 only
130 std::_Destroy(__result, __cur, __alloc);
131 __throw_exception_again;
136 template<typename _InputIter, typename _Size, typename _ForwardIter,
137 --- gcc-4.0.1-20050607/libstdc++-v3/include/ext/hashtable.h.old 2005-06-11 03:58:20.000000000 -0700
138 +++ gcc-4.0.1-20050607/libstdc++-v3/include/ext/hashtable.h 2005-06-11 04:14:28.384482592 -0700
139 @@ -607,13 +607,13 @@
142 this->get_allocator().construct(&__n->_M_val, __obj);
148 __throw_exception_again;