Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sqlite3secure warnings on linux #1

Closed
dmgawel opened this issue Jan 30, 2016 · 4 comments
Closed

sqlite3secure warnings on linux #1

dmgawel opened this issue Jan 30, 2016 · 4 comments
Assignees

Comments

@dmgawel
Copy link

dmgawel commented Jan 30, 2016

When building moneymanagerex which uses wxsqlite3 with secure and extension functions on Linux I got following errors:

/home/dawid/Development/mmex/build/bk-deps g++ -c -o wxsqlite_wxsqlite3.o -DNOPCH -DSQLITE_CORE -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_HAS_CODEC -DSQLITE_ENABLE_EXTFUNC -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_JSON1 -DHAVE_ACOSH -DHAVE_ASINH -DHAVE_ATANH -DHAVE_ISBLANK -DWXSQLITE3_HAVE_CODEC -DWXSQLITE3_HAVE_METADATA -DWXSQLITE3_USER_AUTHENTICATION -I../lib/wxsqlite3/sqlite3/secure/src -I../lib/wxsqlite3/include -fPIC -DPIC -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread  -g -O2 -std=c++11 -g0 -O2 ../lib/wxsqlite3/src/wxsqlite3.cpp
/home/dawid/Development/mmex/build/bk-deps gcc -c -o wxsqlite_sqlite3secure.o -DNOPCH -DSQLITE_CORE -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_HAS_CODEC -DSQLITE_ENABLE_EXTFUNC -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_JSON1 -DHAVE_ACOSH -DHAVE_ASINH -DHAVE_ATANH -DHAVE_ISBLANK -DWXSQLITE3_HAVE_CODEC -DWXSQLITE3_HAVE_METADATA -DWXSQLITE3_USER_AUTHENTICATION -I../lib/wxsqlite3/sqlite3/secure/src -I../lib/wxsqlite3/include -fPIC -DPIC -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread  -g -O2 -g0 -O2 ../lib/wxsqlite3/sqlite3/secure/src/sqlite3secure.c
In file included from ../lib/wxsqlite3/sqlite3/secure/src/sqlite3secure.c:68:0:
../lib/wxsqlite3/sqlite3/secure/src/extensionfunctions.c:213:25: error: conflicting types for ‘i64’
 typedef int64_t         i64;
                         ^
In file included from ../lib/wxsqlite3/sqlite3/secure/src/sqlite3secure.c:13:0:
../lib/wxsqlite3/sqlite3/secure/src/sqlite3.c:9627:22: note: previous declaration of ‘i64’ was here
 typedef sqlite_int64 i64;          /* 8-byte signed integer */
                      ^
In file included from ../lib/wxsqlite3/sqlite3/secure/src/sqlite3secure.c:68:0:
../lib/wxsqlite3/sqlite3/secure/src/extensionfunctions.c: In function ‘print_elem’:
../lib/wxsqlite3/sqlite3/secure/src/extensionfunctions.c:1966:3: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘int64_t’ [-Wformat=]
   printf("%d => %lld\n", ee,c);
   ^
make: *** [wxsqlite_sqlite3secure.o] Error 1

It looks wxsqlite3 related.

g++ (Ubuntu 4.9.3-8ubuntu2~14.04) 4.9.3

@utelle
Copy link
Owner

utelle commented Jan 30, 2016

This seems to be an issue of the "extension functions" module. Could you please comment out lines 211 and 213 in file extensionfunctions.c like line 212 and check whether this solves the issue? Thanks.

@utelle utelle self-assigned this Jan 30, 2016
@dmgawel
Copy link
Author

dmgawel commented Feb 2, 2016

Kinda helped. Project now builds (which is great) but some warnings are still there. I'm not sure if I should make PR with your suggestion or you want to dig deeper?

/home/dawid/Development/mmex/build/bk-deps g++ -c -o wxsqlite_wxsqlite3.o -DNOPCH -DSQLITE_CORE -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_HAS_CODEC -DSQLITE_ENABLE_EXTFUNC -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_JSON1 -DHAVE_ACOSH -DHAVE_ASINH -DHAVE_ATANH -DHAVE_ISBLANK -DWXSQLITE3_HAVE_CODEC -DWXSQLITE3_HAVE_METADATA -DWXSQLITE3_USER_AUTHENTICATION -I../lib/wxsqlite3/sqlite3/secure/src -I../lib/wxsqlite3/include -fPIC -DPIC -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread  -g -O2 -std=c++11 -g0 -O2 ../lib/wxsqlite3/src/wxsqlite3.cpp
/home/dawid/Development/mmex/build/bk-deps gcc -c -o wxsqlite_sqlite3secure.o -DNOPCH -DSQLITE_CORE -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_HAS_CODEC -DSQLITE_ENABLE_EXTFUNC -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_JSON1 -DHAVE_ACOSH -DHAVE_ASINH -DHAVE_ATANH -DHAVE_ISBLANK -DWXSQLITE3_HAVE_CODEC -DWXSQLITE3_HAVE_METADATA -DWXSQLITE3_USER_AUTHENTICATION -I../lib/wxsqlite3/sqlite3/secure/src -I../lib/wxsqlite3/include -fPIC -DPIC -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread  -g -O2 -g0 -O2 ../lib/wxsqlite3/sqlite3/secure/src/sqlite3secure.c
In file included from ../lib/wxsqlite3/sqlite3/secure/src/sqlite3secure.c:68:0:
../lib/wxsqlite3/sqlite3/secure/src/extensionfunctions.c: In function ‘modeFinalize’:
../lib/wxsqlite3/sqlite3/secure/src/extensionfunctions.c:1545:23: warning: passing argument 2 of ‘map_iterate’ from incompatible pointer type
     map_iterate(p->m, modeIterate, p);
                       ^
../lib/wxsqlite3/sqlite3/secure/src/extensionfunctions.c:190:6: note: expected ‘map_iterator’ but argument is of type ‘void (*)(void *, i64,  void *)’
 void map_iterate(map *m, map_iterator iter, void* p);
      ^
../lib/wxsqlite3/sqlite3/secure/src/extensionfunctions.c: In function ‘_medianFinalize’:
../lib/wxsqlite3/sqlite3/secure/src/extensionfunctions.c:1566:23: warning: passing argument 2 of ‘map_iterate’ from incompatible pointer type
     map_iterate(p->m, medianIterate, p);
                       ^
../lib/wxsqlite3/sqlite3/secure/src/extensionfunctions.c:190:6: note: expected ‘map_iterator’ but argument is of type ‘void (*)(void *, i64,  void *)’
 void map_iterate(map *m, map_iterator iter, void* p);
      ^
../lib/wxsqlite3/sqlite3/secure/src/extensionfunctions.c: In function ‘print_elem’:
../lib/wxsqlite3/sqlite3/secure/src/extensionfunctions.c:1966:3: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘int64_t’ [-Wformat=]
   printf("%d => %lld\n", ee,c);
   ^
rm -f libwxsqlite.a
ar rcu libwxsqlite.a wxsqlite_wxsqlite3.o wxsqlite_sqlite3secure.o
ranlib libwxsqlite.a

@utelle
Copy link
Owner

utelle commented Feb 4, 2016

I made a few modifications to the source code of the extension functions that hopefully solve the issue.

Please check whether there are still warning messages issued. If yes, please let me know.

@dmgawel
Copy link
Author

dmgawel commented Feb 5, 2016

Works perfect! No warnings. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants