
28 Aug
2010
28 Aug
'10
9:11 p.m.
On Sat, 2010-08-28 at 22:17 +0300, Robert Ramey wrote:
d) some were too hard to fix/eliminate comparison between signed/unsigned - I just left them because I didn't know how to fix them
Am I missing some complication I'm not aware of? In my experience this warning is just about always the result of using int for variables which should be of type size_t, as in for(int i=0; i<object.size(); i++) If I cannot redefine all the types to unsigned, something like this usually fixes the problem: if ( size >= 0 && static_cast<size_t>(size) < object.size() ) Writing static_casts is annoying, but it is often necessary if you want to remain -Wall -pedantic. --> Mika Heiskanen