STL compiler warning, very strange

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Wed Jun 28 13:54:00 GMT 2000


> I am getting a rather strange warning (using -Wall) from gcc with
> STL with the following code.  When using an iterator in deque::erase()
> I'm getting a warning about comparing a signed to an unsigned:
[...]
>         schedule_q.erase( index);  <-- here
[...]
> /usr/local/include/g++/stl_deque.h: In method `struct
> __deque_iterator<instruction_t,instruction_t &,instruction_t *,0>
> deque<instruction_t,__default_alloc_template<false,0>,0>::erase<
> instruction_t, alloc, 0>(struct __deque_iterator<instruction_t,instruction_t
> &,instruction_t *,0>)':
> SEQ_FPU_Irr.C:369:   instantiated from here
> /usr/local/include/g++/stl_deque.h:533: warning: comparison between signed and
> unsigned

Thanks for your bug report. Please have a look at the error again, it
indicates that the problem is in line 533 of stl_deque.h, i.e. in
libstdc++ proper. It shouldn't be too difficult to correct this in
your installation of gcc; please send a patch to
gcc-patches@gcc.gnu.org when you found a fix that
works. Alternatively, you could check the latest version of SGI STL,
since g++ always incorporates the SGI code in this area.

Regards,
Martin



More information about the Gcc-bugs mailing list