Re: [sqlite] Request to change int parameter to size_t parameter / potential bug on iOS (64 bit)

2014-09-08 Thread Nelson, Erik - 2
> Roger Binns wrote on Sunday, September 07, 2014 2:30 PM > On 07/09/14 11:19, Richard Hipp wrote: > > Please use a cast to silence the compiler warnings. > "(int)sizeof(...)" > > instead of just "sizeof(...)". > > That isn't safe for correctly written 64 bit apps. For example they > could end

Re: [sqlite] Request to change int parameter to size_t parameter / potential bug on iOS (64 bit)

2014-09-07 Thread skywind mailing lists
Am 07.09.2014 um 21:52 schrieb Simon Slavin : > > On 7 Sep 2014, at 7:19pm, Richard Hipp wrote: > >> mailingli...@skywind.eu> wrote: >> >>> Is it possible to change the fourth parameter in sqlite3_bind_XXX (and >>> probably other locations) because this

Re: [sqlite] Request to change int parameter to size_t parameter / potential bug on iOS (64 bit)

2014-09-07 Thread Simon Slavin
On 7 Sep 2014, at 7:19pm, Richard Hipp wrote: > mailingli...@skywind.eu> wrote: > >> Is it possible to change the fourth parameter in sqlite3_bind_XXX (and >> probably other locations) because this seems to be for me the appropriate >> type?! > > No. That would be a

Re: [sqlite] Request to change int parameter to size_t parameter / potential bug on iOS (64 bit)

2014-09-07 Thread Roger Binns
On 07/09/14 11:19, Richard Hipp wrote: > Please use a cast to silence the compiler warnings. "(int)sizeof(...)" > instead of just "sizeof(...)". That isn't safe for correctly written 64 bit apps. For example they could end up with data items that are bigger than 2GB correctly using (s)size_t.

Re: [sqlite] Request to change int parameter to size_t parameter / potential bug on iOS (64 bit)

2014-09-07 Thread Roger Binns
On 07/09/14 10:02, skywind mailing lists wrote: > I have seen that SQLite uses normally parameters of type "int" to pass the > size of a variable Correct. It should be using size_t or ssize_t, but the SQLite developers chose not to do that, especially as at the time of the decision those

Re: [sqlite] Request to change int parameter to size_t parameter / potential bug on iOS (64 bit)

2014-09-07 Thread Richard Hipp
On Sun, Sep 7, 2014 at 1:02 PM, skywind mailing lists < mailingli...@skywind.eu> wrote: > > Is it possible to change the fourth parameter in sqlite3_bind_XXX (and > probably other locations) because this seems to be for me the appropriate > type?! > No. That would be a compatibility break.

Re: [sqlite] Request to change int parameter to size_t parameter / potential bug on iOS (64 bit)

2014-09-07 Thread Stephan Beal
On Sun, Sep 7, 2014 at 8:08 PM, Stephen Chrzanowski wrote: > On Sun, Sep 7, 2014 at 1:02 PM, skywind mailing lists < > mailingli...@skywind.eu> wrote:> type?! On iOS 64bit the size of int is 4 > bytes and the size of size_t is 8 > > bytes. In this case the fourth parameter

Re: [sqlite] Request to change int parameter to size_t parameter / potential bug on iOS (64 bit)

2014-09-07 Thread Stephen Chrzanowski
Wouldn't it come down to the compiler you're using that'd indicate the number of bytes associated to an integer type, or at least tell the compiler to compile integer types to 64-bit? On Sun, Sep 7, 2014 at 1:02 PM, skywind mailing lists < mailingli...@skywind.eu> wrote: > Hello, > > I have

[sqlite] Request to change int parameter to size_t parameter / potential bug on iOS (64 bit)

2014-09-07 Thread skywind mailing lists
Hello, I have seen that SQLite uses normally parameters of type "int" to pass the size of a variable (see sqlite3_bind_blob, fourth parameter). When compiling SQLite3 with Clang and some warnings enabled I get warnings when passing sizeof(...) as the fourth parameter. The reason is that