dark0s dark0s wrote:
> I need help. I am doing sqlite3 extension, but something don't work at 
> compile time.
> 
> The output of compiler is:
> bash-3.1# gcc -lsqlite3 labsinf.c -o inf
> labsinf.c: In function 'soundex':
> labsinf.c:16: warning: assignment discards qualifiers from pointer target type
> 
>   
>   str = sqlite3_value_text(values[0]);

Your problem is that the sqlite3_value_text() function is defined to 
return a const unsigned char pointer, and you are assigning that value 
to a non-const signed char pointer. From the documentation at 
http://www.sqlite.org/c3ref/value_blob.html

   const unsigned char *sqlite3_value_text(sqlite3_value*);

Your assignment above discards the const qualifier. It also ignores the 
fact that the types differ in their signedness. You should change your 
str variable to be a const char pointer, and then explicitly cast away 
the unsigned qualifier.

   const char *str;

   str = (const char*)sqlite3_value_text(...);

HTH
Dennis Cote

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to