3 # Run this script in a directory with a working makefile to check for
4 # compiler warnings in SQLite.
7 if uname |
grep -i openbsd
; then
8 # Use these for testing on OpenBSD:
10 WARNING_ANDROID_OPTS
=-Wall
12 # Use these for testing on Linux and Mac OSX:
13 WARNING_OPTS
="-Wshadow -Wall -Wextra -pedantic-errors -Wno-long-long"
14 gccvers
=`gcc -v 2>&1 | grep '^gcc version'`
15 if test "$gccvers" '<' 'gcc version 6'
17 WARNING_ANDROID_OPTS
="-Wshadow -Wall -Wextra"
19 WARNING_ANDROID_OPTS
="-Wshadow -Wall -Wextra -Wimplicit-fallthrough=0"
25 echo '********** No optimizations. Includes FTS4/5, GEOPOLY, JSON1 ***'
26 echo '********** ' Options
: $WARNING_OPTS
27 gcc
-c $WARNING_OPTS -std=c89 \
28 -ansi -DHAVE_STDINT_H -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_GEOPOLY \
29 -DSQLITE_ENABLE_FTS5 \
31 if test x
`uname` = 'xLinux'; then
32 echo '********** Android configuration ******************************'
33 echo '********** ' Options
: $WARNING_ANDROID_OPTS
36 -DSQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576 \
37 -DSQLITE_THREADSAFE=2 \
38 -DSQLITE_TEMP_STORE=3 \
39 -DSQLITE_POWERSAFE_OVERWRITE=1 \
40 -DSQLITE_DEFAULT_FILE_FORMAT=4 \
41 -DSQLITE_DEFAULT_AUTOVACUUM=1 \
42 -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1 \
43 -DSQLITE_ENABLE_FTS3 \
44 -DSQLITE_ENABLE_FTS3_BACKWARDS \
45 -DSQLITE_ENABLE_FTS4 \
46 -DSQLITE_OMIT_BUILTIN_TEST \
47 -DSQLITE_OMIT_COMPILEOPTION_DIAGS \
48 -DSQLITE_OMIT_LOAD_EXTENSION \
49 -DSQLITE_DEFAULT_FILE_PERMISSIONS=0600 \
52 $WARNING_ANDROID_OPTS \
55 echo '********** No optimizations. ENABLE_STAT4. THREADSAFE=0 *******'
56 echo '********** ' Options
: $WARNING_OPTS
57 gcc
-c $WARNING_OPTS -std=c89 \
58 -ansi -DSQLITE_ENABLE_STAT4 -DSQLITE_THREADSAFE=0 \
60 echo '********** Optimized -O3. Includes FTS4/5, GEOPOLY, JSON1 ******'
61 echo '********** ' Options
: $WARNING_OPTS
62 gcc
-O3 -c $WARNING_OPTS -std=c89 \
63 -ansi -DHAVE_STDINT_H -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_GEOPOLY \
64 -DSQLITE_ENABLE_FTS5 \