[EMAIL PROTECTED] wrote: > > Christian Werner <[EMAIL PROTECTED]> wrote: > > > > What about using the ptrdiff_t type in those places instead. > > > > Is ptrdiff_t implemented on all C compiler environments that > SQLite builds on?
I'm afraid not, thus some autoconf logic might be required to detect its availability. > Also, will it really eliminate the warnings. In several places > we are storing a (32-bit) integer in a pointer. > > p = (char*)i; > > And then later we get the integer back out: > > i = (int)p; When the context allows to change i's type to ptrdiff_t then you get i = (ptrdift_t)p; which eliminates the warning. > If we change to ptrdiff_t, then we have: > > p = (char*)(ptrdiff_t)i; /* Convoluted, but works */ > i = (int)(ptrdiff_t)p; /* Still get a warning? */ > > In the conversion from pointer back to integer, don't we still > get a warning about casting a 64-bit integer into a 32-bit > integer? (I don't know because I do not have a 64-bit machine > easily at hand to test it on.) See above, when it's irrelevant if i is a 32 or 64 bit data type, the 32 vs. 64 bit warning blues is gone. Regards, Christian ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------