24 mar 2013 kl. 02.39 skrev Ben Reser:
I build trunk on OS X at least once a day with sqlite-amalgamation and
it builds fine for me. It throws a bunch of warnings but I don't
think the warnings have anything to do with -std=c89. What errors or
problems are you seeing? What compiler are you using? What config
options are you using? What version of sqlite3 are using? What
version of OS X?
It's 10.5.8, the most recent to run on PowerPC. (And /usr/bin/gcc,
which is 4.0.1 plus the usual Apple patches, and sqlite3-amalgamation
3.7.15.2, but these don't matter.)
gcc -std=c89 /usr/include/libkern/OSAtomic.h -o /dev/null
/usr/include/libkern/OSAtomic.h:71: error: syntax error before ‘static’
/usr/include/libkern/OSAtomic.h:74: error: syntax error before ‘static’
/usr/include/libkern/OSAtomic.h:78: error: syntax error before ‘static’
/usr/include/libkern/OSAtomic.h:81: error: syntax error before ‘static’
(OSAtomic.h contains functions declared "inline static", which is not
valid C89. Presumably this has been changed in newer versions.)
Perhaps this particular problem could be hacked around with some
preprocessor work. However, the point is that we cannot expect to
compile externally obtained sources with any compilation options that
happen to work for our own code. SQLite or OS X are not "broken"
because they don't work with -std=c89. External code may work with our
non-default flags, but we should not be surprised when they don't.