This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[libstdc++]: Proposed patch for libstdc++/2694
- To: gcc-patches at gcc dot gnu dot org
- Subject: [libstdc++]: Proposed patch for libstdc++/2694
- From: Peter Schmid <schmid at snake dot iap dot physik dot tu-darmstadt dot de>
- Date: Mon, 30 Apr 2001 20:51:04 +0200 (CEST)
- cc: libstdc++ at gcc dot gnu dot org
The following patch fixes the bogos warning described in
libstdc++/2694. After applying the patch, both testcases compile without
the "unsigned expression >= 0 is always true warning" message.
Hope this helps,
Peter Schmid
2001-04-30 Peter Schmid <schmid@snake.iap.physik.tu-darmstadt.de>
* include/bits/stl_iterator_base_funcs.h: Avoid signedness
warning in __advance
*** libstdc++-v3/include/bits/stl_iterator_base_funcs.h.orig Mon Apr 30 19:40:38 2001
--- libstdc++-v3/include/bits/stl_iterator_base_funcs.h Mon Apr 30 19:41:02 2001
*************** inline void __advance(_BidirectionalIter
*** 120,126 ****
{
// concept requirements
__glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIterator>);
! if (__n >= 0)
while (__n--) ++__i;
else
while (__n++) --__i;
--- 120,129 ----
{
// concept requirements
__glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIterator>);
!
! if (__n == 0)
! return;
! else if (__n > 0)
while (__n--) ++__i;
else
while (__n++) --__i;