Hello,

On Thu, Sep 8, 2011 at 11:32, Stephan Beal <[email protected]> wrote:
[...]
> The compile warning says it all:
>
> [stephan@cheyenne:~/cvs/fossil/whiki]$ make
> + cc -pedantic -Wall -Werror -fPIC -std=c89 -g -I. -I. -I./include
> -DSQLITE_THREADSAFE=0 -DSQLITE_TEMP_STORE=3 -DSQLITE_OMIT_LOAD_EXTENSION=1
> -c -o sqlite3.o sqlite3.c
> cc1: warnings being treated as errors
> sqlite3.c:801: error: ISO C90 does not support 'long long'
> sqlite3.c:802: error: ISO C90 does not support 'long long'
> make: *** [sqlite3.o] Error 1
>
> [stephan@cheyenne:~/cvs/fossil/whiki]$ sed -n 800,803p sqlite3.c
> #else
>  typedef long long int sqlite_int64;
>  typedef unsigned long long int sqlite_uint64;
> #endif
>
> i unfortunately cannot propose a portable alternative.
>
> This probably isn't going to bother most people, but in a recent discussion
> it was mentioned that c89 mode should work for fossil (and, by
> extension/implication, sqlite), if only to maximize portability.

As far as I know, there is no portable way of defining 64-bit integers
on ISO C90, so, by definition, it's a mission impossible.

Only C99 come with the «stdint.h» header which would define the
"int64_t" and "uint64_t" types, if supported by the platform (one way
to check is to verify if the INT64_MAX macro is defined).

Off course you can always use "#ifdef"s to workaround this limitation
on C90, but no "true answer" (TM) exists.

If I remember correctly, you can use the <stdint.h> header in C89 mode
with the Linux libc, so you could workaround with that in mind.


Regards,
~Nuno Lucas
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to