Compiling version 3.7.3...this warning has actually been around a while though 
I can't find anybody reporting it for sqlite3...
 
gcc44 -O3 -Wall -fPIC -DNO_GETTOD -c sqlite3.c
sqlite3.c: In function âfkLookupParentâ:
sqlite3.c:55430: warning: assuming signed overflow does not occur when assuming 
that (X - c) <= X is always true
 
gcc44 (GCC) 4.4.0 20090514 (Red Hat 4.4.0-6)
 
Compile with -O1 and no warning
 
Compile with gcc 4.1.2 and -O3 and no warning either
 
Appears the new optimization causes this...
 
If I change the line to this the warning goes away:
  if( (unsigned int)p->nOp>(unsigned int)addr){
 
Since these appear to be used as unsigned values anyways this looks like a 
valid way to supress the warning.
 
Would also appear to need a
assert( p->nOp>=0 );
 
In all these related functions too.
 
I guess leaving these values as signed allows some checking if they go haywire 
for any reason...when debug is turned on for the asserts.
 
 
Michael D. Black
Senior Scientist
Advanced Analytics Directorate
Northrop Grumman Information Systems
 
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to