cygwin g++ strictness

Dave Korn
Fri Oct 31 15:46:00 GMT 2008

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.

Can't think of a witty .sigline today....

Unsubscribe info:
Problem reports:

More information about the Cygwin mailing list