John Emmas wrote on 31 October 2008 15:35: > is it reasonable for a programmer to assume that a type declared as > int32_t will be compatible with "%d" when building for a 32-bit platform?
The /only/ assumptions you may legitimately make are those encoded in the C language spec: sizeof (char) <= sizeof (short) <= sizeof (int) <= sizeof (long) <= sizeof (long long). But "<=" means less than OR equal, and you can't assume /which/ of those two. > I'd be surprised if there's a programmer amongst us who can honestly say > he wouldn't have made that assumption. It's worked in the past. But now there are 64-bit platforms in common use and we all have to be aware. cheers, DaveK -- Can't think of a witty .sigline today.... -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/