On Mon, Apr 8, 2013 at 9:10 AM, Michael Black <mdblac...@yahoo.com> wrote:
> Which is why...IMHO....to avoid all the repeats of this question in the 
> future (and from the past)....one should simply to do the cast to int and put 
> a comment on the line that says " % int always fits in an int".

Explicit casts shut up the compiler.  If that's all you want, well,
sure.  But explicit casts often hide bugs.  This one is a compiler
bug.

> Too bad one can't cast to the type of a variable though in C.

Well, one can, with GCC, but, yeah.

> And if IBuf is an int do you really want that to be a 64-bit int on a 64-bit 
> compiler?

That's a different story.  SQLite3 and just about everything should be
using specific int sizes precisely because they could vary.  In
practice though, the only architectures of any relevance where you're
likely to find sizeof(int) != sizeof(int32_t) are Crays and 16-bit
CPUs, and if SQLite3 doesn't claim to run on those then that's kinda
good enough.

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

Reply via email to