This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[libstdc++]: Proposed patch for libstdc++/2694



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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]