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 SOLARIS, compiling (C++ compiler, .cpp module) when
>> passing SQLITE_STATIC produces this rather annoying warning:
>>
>> Warning (Anachronism): Formal argument 5 of type extern "C"
>> void(*)(void*) in call to sqlite3_bind_text(sqlite3_stmt*, int, const
>> char*, int, extern "C" void(*)(void*)) is being passed void(*)(void*).
>>
>> Thanks for your help,
>>
>> -- Gerry Blanchette
>>  
>>
> 
> When you #include <sqlite3.h>, you should enclose that #include in this
> construct:
> 
> extern "C" {
> #include <sqlite3.h>
> }
> 
> That may solve your problem.

"sqlite3.h" contains:

#ifdef __cplusplus
extern "C" {
#endif

....

#ifdef __cplusplus
}  /* End of the 'extern "C"' block */
#endif

It does the `extern "C"' block automatically.



> 
> Likewise, the function that you pass should be declared 'extern "C"' if
> it's one of your own functions.

I agree with this one.

extern "C" void foo (void*);
  and
void foo (void *);

are two different types.


Gé

> 
> HTH
> 
> Ulrik Petersen
> 

Reply via email to