Snapshot of upstream SQLite 3.34.1
[sqlcipher.git] / tool / warnings.sh
blob0754a0f3f6f907b8600b44f33892953d820a436f
1 #/bin/sh
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:
9 WARNING_OPTS=-Wall
10 WARNING_ANDROID_OPTS=-Wall
11 else
12 # Use these for testing on Linux and Mac OSX:
13 WARNING_OPTS="-Wshadow -Wall -Wextra -pedantic-errors -Wno-long-long"
14 WARNING_ANDROID_OPTS="-Wshadow -Wall -Wextra"
17 rm -f sqlite3.c
18 make sqlite3.c
19 echo '********** No optimizations. Includes FTS4/5, GEOPOLY, JSON1 ***'
20 echo '********** ' Options: $WARNING_OPTS
21 gcc -c $WARNING_OPTS -std=c89 \
22 -ansi -DHAVE_STDINT_H -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_GEOPOLY \
23 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 \
24 sqlite3.c
25 if test x`uname` = 'xLinux'; then
26 echo '********** Android configuration ******************************'
27 echo '********** ' Options: $WARNING_ANDROID_OPTS
28 gcc -c \
29 -DHAVE_USLEEP=1 \
30 -DSQLITE_HAVE_ISNAN \
31 -DSQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576 \
32 -DSQLITE_THREADSAFE=2 \
33 -DSQLITE_TEMP_STORE=3 \
34 -DSQLITE_POWERSAFE_OVERWRITE=1 \
35 -DSQLITE_DEFAULT_FILE_FORMAT=4 \
36 -DSQLITE_DEFAULT_AUTOVACUUM=1 \
37 -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1 \
38 -DSQLITE_ENABLE_FTS3 \
39 -DSQLITE_ENABLE_FTS3_BACKWARDS \
40 -DSQLITE_ENABLE_FTS4 \
41 -DSQLITE_OMIT_BUILTIN_TEST \
42 -DSQLITE_OMIT_COMPILEOPTION_DIAGS \
43 -DSQLITE_OMIT_LOAD_EXTENSION \
44 -DSQLITE_DEFAULT_FILE_PERMISSIONS=0600 \
45 -DSQLITE_ENABLE_ICU \
46 -DUSE_PREAD64 \
47 $WARNING_ANDROID_OPTS \
48 -Os sqlite3.c shell.c
50 echo '********** No optimizations. ENABLE_STAT4. THREADSAFE=0 *******'
51 echo '********** ' Options: $WARNING_OPTS
52 gcc -c $WARNING_OPTS -std=c89 \
53 -ansi -DSQLITE_ENABLE_STAT4 -DSQLITE_THREADSAFE=0 \
54 sqlite3.c
55 echo '********** Optimized -O3. Includes FTS4/5, GEOPOLY, JSON1 ******'
56 echo '********** ' Options: $WARNING_OPTS
57 gcc -O3 -c $WARNING_OPTS -std=c89 \
58 -ansi -DHAVE_STDINT_H -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_GEOPOLY \
59 -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 \
60 sqlite3.c