Re: [sqlite] sqlite3_bind_text and SQLITE_STATIC

2012-05-22 Thread Pavel Ivanov
> I'd expect that after sqlite3_step is done I can safely change > that buffers, but it seems not. > Is it a bug? Feature or incorrect use of SQLITE_STATIC It's an incorrect use of SQLITE_STATIC. Only call to sqlite3_finalize() can guarantee you that buffer won't be used again. Probably a pair of

[sqlite] sqlite3_bind_text and SQLITE_STATIC

2012-05-22 Thread Artyom Beilis
Hello, One of the things that is useful is sqlite3_bind_text is SQLITE_STATIC that allows to reduce memory copy. I assumed that I need to keep the value valid until I execute that statement, however I discovered it does not work this way: Following simple program prints "xbcd" instead of expected

Re: [sqlite] sqlite3_bind_text() and SQLITE_STATIC question

2005-05-02 Thread Gé Weijers
Greg Miller wrote: > Thomas Briggs wrote: > >> >> >>> From the looks of this warning, I would guess that you could redefine >>> SQLITE_STATIC like this (or some variation of this that is legal C++) >>> to solve >>> the problem: >>> >>> #define SQLITE_STATIC ((extern "C" void(*)(void*)) 0) what

Re: [sqlite] sqlite3_bind_text() and SQLITE_STATIC question

2005-05-01 Thread Greg Miller
Thomas Briggs wrote: From the looks of this warning, I would guess that you could redefine SQLITE_STATIC like this (or some variation of this that is legal C++) to solve the problem: #define SQLITE_STATIC ((extern "C" void(*)(void*)) 0) I don't think there's any legal way to do this, is t

Re: [sqlite] sqlite3_bind_text() and SQLITE_STATIC question

2005-04-27 Thread Jay Sprenkle
On 4/27/05, Thomas Briggs <[EMAIL PROTECTED]> wrote: > > > From the looks of this warning, I would guess that you could redefine > > SQLITE_STATIC like this (or some variation of this that is > > legal C++) to solve > > the problem: > > > > #define SQLITE_STATIC ((extern "C" void(*)(void*)) 0) >

RE: [sqlite] sqlite3_bind_text() and SQLITE_STATIC question

2005-04-27 Thread Thomas Briggs
> From the looks of this warning, I would guess that you could redefine > SQLITE_STATIC like this (or some variation of this that is > legal C++) to solve > the problem: > > #define SQLITE_STATIC ((extern "C" void(*)(void*)) 0) I don't think there's any legal way to do this, is there? Li

Re: [sqlite] sqlite3_bind_text() and SQLITE_STATIC question

2005-04-27 Thread Derrell . Lipman
"Gerry Blanchette" <[EMAIL PROTECTED]> writes: > Clearly, the C++ compiler is substituting SQLITE_STATIC with ((void(*)(void > *))0), as the warning from the Solaris C++ compiler claims: > > Warning (Anachronism): Formal argument 5 of type extern "C" void(*)(void*) in > call to sqlite3_bind_text

RE: [sqlite] sqlite3_bind_text() and SQLITE_STATIC question

2005-04-27 Thread Gerry Blanchette
ng way to sidestep this issue, what is typically done to placate this warning? Thanks again, -- Gerry Blanchette -Original Message- From: Gé Weijers [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 27, 2005 1:09 PM To: [email protected] Subject: Re: [sqlite] sqlite3_bind_text()

Re: [sqlite] sqlite3_bind_text() and SQLITE_STATIC question

2005-04-27 Thread Gé Weijers
Ulrik Petersen wrote: > Hi Gerry, > > Gerry Blanchette wrote: > >> Greetings All, >> In general, is passing NULL to sqlite3_bind_text() as parameter 5 valid, >> instead of using either SQLITE_STATIC or SQLITE_TRANSIENT? (My bind >> value is a heap pointer which I manage). >> >> I ask because on S

Re: [sqlite] sqlite3_bind_text() and SQLITE_STATIC question

2005-04-27 Thread Ulrik Petersen
Hi Gerry, Gerry Blanchette wrote: Greetings All, In general, is passing NULL to sqlite3_bind_text() as parameter 5 valid, instead of using either SQLITE_STATIC or SQLITE_TRANSIENT? (My bind value is a heap pointer which I manage). I ask because on SOLARIS, compiling (C++ compiler, .cpp module) wh

[sqlite] sqlite3_bind_text() and SQLITE_STATIC question

2005-04-27 Thread Gerry Blanchette
Greetings All, In general, is passing NULL to sqlite3_bind_text() as parameter 5 valid, instead of using either SQLITE_STATIC or SQLITE_TRANSIENT? (My bind value is a heap pointer which I manage). I ask because on SOLARIS, compiling (C++ compiler, .cpp module) when passing SQLITE_STATIC produces