crawshaw / sqlite

Go SQLite3 driver
ISC License
561 stars 67 forks source link

Build failure when using gcc 12. #139

Open nkolotov opened 1 year ago

nkolotov commented 1 year ago

Attempt to build when using gcc 12.2.0 fails with the following error:

go build
# crawshaw.io/sqlite
In file included from /home/niko/go/pkg/mod/crawshaw.io/sqlite@v0.3.2/static.go:19:
/home/niko/go/pkg/mod/crawshaw.io/sqlite@v0.3.2/./c/sqlite3.c: In function 'sqlite3Fts5IndexQuery':
/home/niko/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);
       |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# crawshaw.io/sqlite
cgo-generated-wrappers:11:14: error: 'cfree' redeclared as different kind of symbol
In file included from cgo-c-prolog-gccgo:2:
/usr/include/stdlib.h:449:13: note: previous declaration of 'cfree' with type 'void(void *)'
  449 | extern void cfree (void *__ptr) __THROW;
      |             ^~~~~
BlitzBanana commented 1 year ago

image gcc (GCC) 12.3.1 20230508 (Red Hat 12.3.1-1)