[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: sqlite3.c won't compile with -std=c89

From: Mattias Engdegård <mattiase_at_bredband.net>
Date: Sun, 24 Mar 2013 12:29:43 +0100

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.
Received on 2013-03-24 12:30:29 CET

This is an archived mail posted to the Subversion Dev mailing list.