On Fri, Oct 24, 2008 at 08:44:14PM +0200, Thomas Orgis wrote:
The build of dillo with gcc-4.3 spills out quite some warning messages.
I propose attached patch to fix these. Most are about all these loops without body: gcc suggested to change
for(i=0; i<42; ++i);
to
for(i=0; i<42; ++i) ;
...or append "{}", alternatively. I decided for the subtle space insertion... not sure if I particulary like it, but it makes the compile more silent.
Other warnings are about logical and arithmetical expressions with fewer than recommened parentheses. I suggest people having a close look at these changes... I _think_ I got it right;-)
Committed!
Then at last, there's an unresolved warning:
dillo2-cvs/dw$ LANG=C make textblock.o g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/include -march=pentium-m -O3 -Wall -W -Wno-unused-parameter -MT textblock.o -MD -MP -MF .deps/textblock.Tpo -c -o textblock.o textblock.cc ../lout/misc.hh: In member function 'void dw::Textblock::addLine(int, bool)': ../lout/misc.hh:161: warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false mv -f .deps/textblock.Tpo .deps/textblock.Po
It's about this assert:
inline T* getRef (int i) { if (BOUND_CHECKING) assert (i >= 0 && i < this->num); return array + i; }
Ideas to please gcc with this assert? I am not sure what to think of this.
I have gcc-4.2.4 here. Does this produce the same warning? assert (i >= 0 && this->num - i > 0); -- Cheers Jorge.-