> The version of Jansson is 2.3.1, and it's compiled as a 32-bit
> executable. Looking in jansson.h, i see that it's using
>
> #define JSON_INTEGER_FORMAT "I64d"
> ...
> typedef long long json_int_t;
So evidently the 'long long' type in your environment is also 32-bit.
Many 32-bit environments support an emulated 64-bit long long type.
Are there any compiler flags or such that you could use to get a
64-bit long long even though you're 32-bit?
> Looking over my error log i actually do see the error 'too big integer
> near 4294967295' It was just buried in a slew of other messages. Now,
> is this good behavior for a JSON lexer? I don't argue that flagging an
> integer overflow has occured is a bad idea, but isn't this kind of
> like defining a specific flavor of JSON? If i send perfectly valid
> JSON on a 64-bit machine to a 32-bit machine, I don't think I would
> expect the other machine to choke like that... It makes JSON machine
> dependent all of a sudden. Anyway, just a thought.
Well, that's the case for just about any implementation of JSON in any
language (perhaps with very few exceptions). The JSON spec defines a
syntax that is completely abstract, but eventually you've got to map
it to some specific machine or implementation. You'll even run into a
very similar restriction when using JSON inside of JavaScript.
As an aside, I had been working on an extension to Jansson which would
allow it to use "infinite precision" numeric packages, so that you
would not have to be limited to whatever size your "long long" was. If
you scan this mailing list archives you'll find my "prototype"
patches, which work, but aren't official yet (and will require a few
minor changes before they are accepted .... which I need to get back
to doing).
Anyway, Jansson is for the most part very good at implementing the
complete JSON spec, but there are a few limitations which are
thoroughly documented.
See
http://www.digip.org/jansson/doc/2.3/conformance.html