Quoth Igor Korot <ikoro...@gmail.com>, on 2013-11-29 18:49:05 -0800:
> Trying to change the return type to long does not solve the warning.
> 
> Which value should this function return?

As you can see from http://sqlite.org/c3ref/last_insert_rowid.html, it
returns sqlite3_int64, a signed 64-bit integer type.  The C99 name and
I think the C++11 name for this is int64_t, which is probably what
you want, but I vaguely recall the Microsoft compiler requires jumping
through some kind of hoop to get it.  You could just use sqlite3_int64
directly if you don't mind taking the header dependency.

The truncation is actually a potential error: e.g., a row ID of 2^32
would be returned as 0 instead on a system with 32-bit int.  It's the
sort of thing you might not see in production for a while until it
breaks everything suddenly a ways down the line.

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

Reply via email to