crawshaw / sqlite

Go SQLite3 driver
ISC License
561 stars 67 forks source link

Compilation warning about memcpy with gcc 11.2.0 #127

Open MEschenbacher opened 2 years ago

MEschenbacher commented 2 years ago

Hey, I'm using version 0.3.2 of this lib with go version 1.17.2 and go build prints a compilation warning but the build of my project succeeds.

I have applied system updates last night and I believe compiler versions have changed: gcc from 10.2.1 to 11.2.0

# crawshaw.io/sqlite
In file included from ../../../go/pkg/mod/crawshaw.io/sqlite@v0.3.2/static.go:19:
../../../go/pkg/mod/crawshaw.io/sqlite@v0.3.2/./c/sqlite3.c: In function ‘sqlite3Fts5IndexQuery’:
../../../go/pkg/mod/crawshaw.io/sqlite@v0.3.2/./c/sqlite3.c:220863:18: warning: ‘memcpy’ specified bound 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
220863 |     if( nToken ) memcpy(&buf.p[1], pToken, nToken);
       |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
anacrolix commented 2 years ago

It's quite possible this would get fixed upstream in sqlite.

bobhenkel commented 2 years ago

I'm on go1.16.8 linux/amd64 and seeing the same issue.

AdamSLevy commented 2 years ago

This is mentioned on the forum here. Warnings like this creep in from time to time and generally are nothing to be concerned about. drh knows what he's doing :)

https://sqlite.org/forum/forumpost/f5eed70bd46ede56?t=h

jduerstock commented 2 years ago

I believe this was fixed upstream in sqlite 3.38

leearmstrong commented 2 years ago

Yes this was fixed upstream so would be good to update if we can.

I am seeing this issue too

https://github.com/consbio/mbtileserver/issues/144

CaptainKraft commented 1 year ago

This is still an issue. I'm getting the same warning.

rooton commented 1 year ago

This is still an issue. Ubuntu 22.04 install with GCC 11 with no changed settings and then running go install github.com/consbio/mbtileserver@latest

anacrolix commented 1 year ago

Does updating to master with go get crawshaw.io/sqlite@master remove the warning for anyone?