compiling sqlite3 ends with va_arg error

19 views
Skip to first unread message

Roman Savchenko

unread,
Aug 18, 2022, 11:47:36 AM8/18/22
to emscripten-discuss
Hello all,

I'm trying to compile my project dependecy sqlite3.c amalgamation, and emcc breaks on va_arg with such errors:

sqlite3.c:33735:27: error: unexpected type name 'PrintfArguments': expected expression
pArgList = va_arg(ap, PrintfArguments*);

I tried to search information at the web, but didn't find to much.

Appreciate for any help with it.

Thanks,
Roman.

Sam Clegg

unread,
Aug 18, 2022, 2:53:45 PM8/18/22
to emscripte...@googlegroups.com
Can you give the full command line you are using to compile that file?

Christian Heimes recently added an sqlite3 port to emscripten itself BTW.  You can use it by simply passing `-sUSE_SQLITE3` on the command line.

cheers,
san

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/aba0b1a8-4246-493e-af56-2105caabcd9cn%40googlegroups.com.

Roman Savchenko

unread,
Aug 18, 2022, 4:16:53 PM8/18/22
to emscripte...@googlegroups.com
I'm using the SQLChiper extension so I'm not sure that the mentioned port may help. Verbose make gives following:

/emsdk/upstream/emscripten/emcc
-DSQLITE_ENABLE_JSON1
-DSQLITE_HAS_CODEC
-DSQLITE_OMIT_LOAD_EXTENSION
-DSQLITE_TEMP_STORE=2
-D_GNU_SOURCE
-D_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING
@CMakeFiles/.../includes_C.rsp
-fPIC -g -Qunused-arguments -include -MD -MT sqlite3.c.o -MF sqlite3.c.o.d -o sqlite3.c.o -c sqlite3.c

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.18 (d5ca9bba6513763d5bdddbd0efff759332bd85d7)
Copyright (C) 2014 the Emscripten authors (see AUTHORS.txt)
This is free and open source software under the MIT license.

Thanks,
Roman

чт, 18 авг. 2022 г. в 20:53, 'Sam Clegg' via emscripten-discuss <emscripte...@googlegroups.com>:

Sam Clegg

unread,
Aug 18, 2022, 7:56:42 PM8/18/22
to emscripte...@googlegroups.com
That seems to work fine for me. 

```
$ wget https://www.sqlite.org/2022/sqlite-amalgamation-3390000.zip
$ unzip sqlite-amalgamation-3390000.zip
$ emcc -c -DSQLITE_ENABLE_JSON1 -DSQLITE_HAS_CODEC -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_TEMP_STORE=2 -D_GNU_SOURCE -D_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING -fPIC -g -Qunused-arguments sqlite-amalgamation-3390000/sqlite3.c
```

I guess there could be some flag in `@CMakeFiles/.../includes_C.rsp` that is messing things up but it seems unlikely. 

cheers,
sam


Reply all
Reply to author
Forward
0 new messages