Thomas wrote:
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 was hoping that someone who knows about these things would reply, but no such luck. Does it matter if you put the argument into a variable before calling getRef()? I don't really see what would be special about one particular instance of something->getRef(something->size() - n) when it encountered others earlier without protest, why it would (seemingly) remember that it was given (this->num - n) this one time...
On Tue, Oct 28, 2008 at 11:38:25PM +0000, corvid wrote:
Thomas wrote:
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 was hoping that someone who knows about these things would reply, but no such luck. Does it matter if you put the argument into a variable before calling getRef()?
I don't really see what would be special about one particular instance of something->getRef(something->size() - n) when it encountered others earlier without protest, why it would (seemingly) remember that it was given (this->num - n) this one time...
The problem might be that due to inlining this becomes: assert (this->num - 1 >= 0 && this->num - 1 < this->num); Which looks odd to the compiler. I have no idea how to silence gcc. Perhaps we should just ignore that warning.... Cheers, Johannes
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.-
Am Thu, 30 Oct 2008 14:37:37 -0300 schrieb Jorge Arellano Cid <jcid@dillo.org>:
Does this produce the same warning?
assert (i >= 0 && this->num - i > 0);
That seems to be silent with gcc-4.3.1 ... I won't guarantee anything for gcc-4.3.2, though. But I'll upgrade to that one in the next weeks for sure and will let you know. For now this looks like a fine fix to make dillo2 compiler warning free! Alrighty then, Thomas.
On Thu, Oct 30, 2008 at 07:10:34PM +0100, Thomas Orgis wrote:
Am Thu, 30 Oct 2008 14:37:37 -0300 schrieb Jorge Arellano Cid <jcid@dillo.org>:
Does this produce the same warning?
assert (i >= 0 && this->num - i > 0);
That seems to be silent with gcc-4.3.1 ... I won't guarantee anything for gcc-4.3.2, though. But I'll upgrade to that one in the next weeks for sure and will let you know. For now this looks like a fine fix to make dillo2 compiler warning free!
Committed. -- Cheers Jorge.-
participants (4)
-
corvid@lavabit.com
-
jcid@dillo.org
-
Johannes.Hofmann@gmx.de
-
thomas-forum@orgis.org