STL compiler warning, very strange
Bill Jurasz
bjurasz@ibmoto.com
Wed Jun 28 07:52: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:
Given:
deque<instruction_t> schedule_q; /**< Schedule Queue */
Where instruction_t is a class with mostly unsigned int fields.
Then given:
deque<instruction_t>::iterator index;
for (index = schedule_q.begin();
index < schedule_q.end();
++index)
{
blah blah blah;
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
Our goal is to get rid of all compiler warnings in our code. But this
one is baffling us. Any help would be appreciated.
Also, I'm new here. If I should be posting a question like this to some
other list, please accept my apologies and route me to the correct
forum for this.
--
Bill Jurasz
Lottery: A tax on people who are bad at math.
begin: vcard
fn: Bill Jurasz
n: Jurasz;Bill
org: Somerset, SPS-ASP<BR><img src= http://www.mot.com/img/motobtn.gif ><IMG SRC=" http://www.mot.com/img/homeDNA.gif ">
adr: 7700 W Parmer Lane;;;Austin;TX;78729;USA
email;internet: bjurasz@ibmoto.com
title: Verification Engineer
tel;work: 512-996-6095
tel;fax: 512-996-
x-mozilla-cpt: ;0
x-mozilla-html: FALSE
version: 2.1
end: vcard
More information about the Gcc-bugs
mailing list