Oops...sorry...I copied it from 3.7.3

The line in 3.7.5 is at 55937:
SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe *p, int addr, int val){
  assert( p!=0 );
  assert( addr>=0 );
  if( p->nOp>addr ){              <<< Warning occurs here
    p->aOp[addr].p2 = val;
  }
}

A newer gcc with -O2 or higher will produce it.
Looks like the functions before/after are candidates for the same problem but 
the optimizer apparently doesn't use them.

Michael D. Black
Senior Scientist
NG Information Systems
Advanced Analytics Directorate



________________________________________
From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Richard Hipp [d...@sqlite.org]
Sent: Monday, January 24, 2011 3:58 PM
To: General Discussion of SQLite Database
Subject: EXTERNAL:Re: [sqlite] SQLite version 3.7.5 - code freeze

On Mon, Jan 24, 2011 at 3:36 PM, Black, Michael (IS) <michael.bla...@ngc.com
> wrote:

> Minor item...I reported this before...
> Compiling version 3.7.5...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
>

I cannot associate line "55430" with anything that might generate this
warning.  Can you please identify precisely which version of SQLite you are
compiling in order to get this error message? The identification I want can
be obtained via:

    grep SQLITE_SOURCE_ID sqlite3.c

Or

    sha1sum sqlite3.c




>
> 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){
>

Any branch in SQLite that is always true or always false is identified by
ALWAYS() or NEVER().  This branch is not so identified, and hence there are
cases when it is both true and false.  If your compiler is thinking it is
always true or always false, then I assert that your compiler is broken.

See http://www.sqlite.org/testing.html#coverage for additional information.


>
> 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 );
>
> Michael D. Black
> Senior Scientist
> Northrop Grumman Information Systems
> Advanced Analytics Directorate
>
>
>
> ________________________________________
> From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on
> behalf of Richard Hipp [d...@sqlite.org]
> Sent: Monday, January 24, 2011 12:12 PM
> To: sqlite-...@sqlite.org; General Discussion of SQLite Database
> Subject: EXTERNAL:[sqlite] SQLite version 3.7.5 - code freeze
>
> The current plan is to release SQLite version 3.7.5 on Wednesday of next
> week 2011-02-02.  Please see draft release notes here:
>
>      http://www.sqlite.org/draft/releaselog/3_7_5.html
>
> You can download a snapshot of the latest SQLite amalgamation from here:
>
>      http://www.sqlite.org/draft/download.html
>
> Unless serious problems or omissions are found, there will be no further
> code changes prior to the release of version 3.7.5, except to address
> whatever minor documentation errors, compiler warnings, or other nuisance
> issues that come up during release testing.
>
> Your help in identifying potential problems prior to the release of version
> 3.7.5 is appreciated.  Please download and test the snapshot shown above in
> your applications and let us now (quickly) of any issues you encounter.
>
> As soon as version 3.7.5 is released, our plan is to merge in several other
> changes that currently reside in branches of the source three:
>
>   *  A blocking version of PRAGMA wal_checkpoint that guarantees that the
> WAL file will reset
>   *  Enhancements to the foreign-key checking logic
>   *  Enhancements to the query planner
>
> I'll be asking you to download and test new snapshots after these merges
> occur in early February.  But for now, we want version 3.7.5 to be very
> stable, so please do test as soon as you can and give us feedback right
> away.
>
> Thanks!
>
> --
> D. Richard Hipp
> d...@sqlite.org
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



--
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to