https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124109
Bug ID: 124109
Summary: Bogus -Wstringop-overflow in SQLite source code
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: boris at kolpackov dot net
Target Milestone: ---
Compiling sqlite3.c from the 3.51.2 release (latest at the time of this
submission) with GCC 16 -O3 produces a bunch of the following warnings, which
look bogus to me:
$ gcc-16 -c -O3 -DSQLITE_ENABLE_GEOPOLY=1 -DSQLITE_ENABLE_RTREE=1 sqlite3.c
In function ‘geopolySwab32’,
inlined from ‘geopolyFuncParam’ at sqlite3.c:220355:13,
inlined from ‘geopolyBlobFunc’ at sqlite3.c:220388:16:
sqlite3.c:220171:8: warning: writing 1 byte into a region of size 0
[-Wstringop-overflow=]
220171 | a[0] = a[3];
| ~~~~~^~~~~~
sqlite3.c: In function ‘geopolyBlobFunc’:
sqlite3.c:220140:12: note: at offset [52, 134217716] into destination object
‘a’ of size 32
220140 | GeoCoord a[8]; /* 2*nVertex values. X (longitude) first, then
Y */
Note that there are no such warning if compiling with GCC 15.