Message-ID: <696BA06B3A0FD211BAAD0060B0C4DD83ECA5C9@wntx.tabq.com> From: Wayne Donovan To: "'djgpp-workers AT delorie DOT com'" Subject: Bug in DJGPP V2.03, Simple Error in STL, simple fix given Date: Tue, 6 Feb 2001 17:33:46 +1000 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" Reply-To: djgpp-workers AT delorie DOT com There is a simple bug in the STL Libraries that are distributed with DJGPP V2.03. It only appears depending on which compile time warnings are enabled. ====================== If only the "-Wall" compile warning is turned on, then when using the header file, ==== File: test.cpp ====================== #include int main() { deque _queue; // instantiate an empty queue _queue.push_back( 10 ); // add an element if( _queue.size() ) // if any elements, delete 1st element { deque::iterator it = _queue.begin(); _queue.erase( it ); // STL ERROR HERE } return 1; } Compiling: test.cpp In method `struct _Deque_iterator deque,0>::erase(_Deque_iterator)': test.cpp(26) Error: instantiated from here c:/djgpp/lang/cxx/stl_deque.h(818) Warning: comparison between signed and unsigned There were some errors ========================================== Simple Fix: In c:/djgpp/lang/cxx/stl_deque.h, line 818 (Last updated in 1997 by Silicon Graphics Computer Systems, Inc) Replace: if( __index < (size() >> 1)) { With: if( __index < static_cast(size() >> 1)) { ======================================== Hope this is of some help. This bug probably also occurs more than once in this file. ======================================== Wayne Donovan Network Systems - Gaming phone +61 7 38620317 e-mail