sqlite icon indicating copy to clipboard operation
sqlite copied to clipboard

Compilation warning about memcpy with gcc 11.2.0

Open MEschenbacher opened this issue 3 years ago • 8 comments

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/[email protected]/static.go:19:
../../../go/pkg/mod/crawshaw.io/[email protected]/./c/sqlite3.c: In function ‘sqlite3Fts5IndexQuery’:
../../../go/pkg/mod/crawshaw.io/[email protected]/./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);
       |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

MEschenbacher avatar Nov 04 '21 08:11 MEschenbacher

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

anacrolix avatar Nov 04 '21 21:11 anacrolix

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

bobhenkel avatar Dec 09 '21 21:12 bobhenkel

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

AdamSLevy avatar Dec 27 '21 05:12 AdamSLevy

I believe this was fixed upstream in sqlite 3.38

jduerstock avatar Apr 25 '22 16:04 jduerstock

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

leearmstrong avatar May 04 '22 16:05 leearmstrong

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

CaptainKraft avatar Aug 06 '22 02:08 CaptainKraft

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

rooton avatar Jan 08 '23 17:01 rooton

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

anacrolix avatar Jan 09 '23 02:01 anacrolix