cygwin g++ strictness

Eric Blake ebb9@byu.net
Fri Oct 31 15:40:00 GMT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to John Emmas on 10/31/2008 9:35 AM:
> question - when programming like this:-
> 
> int32_t i = 32;
> printf("%d", i);
> 
> 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?

It is not portable to platforms with 16-bit int (although these days, such
platforms are museumware).  You can probably ignore the warning on 32-bit
platforms, but the better fix is to make your code portable by using
<inttypes.h>.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkkLJo0ACgkQ84KuGfSFAYD5tgCffx96+bqLE/1oyKEAfqY8GDYx
BQMAoLOiBDw4lk+ucH0QIm9QpgBzr6HC
=LoTO
-----END PGP SIGNATURE-----

--
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/



More information about the Cygwin mailing list