sqlite3_column_text() return value

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

sqlite3_column_text() return value

Igor Korot
Hi,
Is there a reason why the aforementioned function returns "const unsigned
char *" instead of just "const char *"?

Will I miss anything if I cast out "unsigned"?

Thank you.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: sqlite3_column_text() return value

Richard Hipp-3
On 8/26/17, Igor Korot <[hidden email]> wrote:
> Hi,
> Is there a reason why the aforementioned function returns "const unsigned
> char *" instead of just "const char *"?

This is due to some bad planning that occurred about 15 years ago, but
which must be carried forward to preserve 100% API compatibility.

>
> Will I miss anything if I cast out "unsigned"?

No.

--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: sqlite3_column_text() return value

Igor Korot
Richard,

On Sat, Aug 26, 2017 at 2:19 PM, Richard Hipp <[hidden email]> wrote:
> On 8/26/17, Igor Korot <[hidden email]> wrote:
>> Hi,
>> Is there a reason why the aforementioned function returns "const unsigned
>> char *" instead of just "const char *"?
>
> This is due to some bad planning that occurred about 15 years ago, but
> which must be carried forward to preserve 100% API compatibility.

It happens to the best of us. ;-)
Compatibility rules and it has to be preserved.

>
>>
>> Will I miss anything if I cast out "unsigned"?
>
> No.

Understood.

Thank you.

>
> --
> D. Richard Hipp
> [hidden email]
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users