This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: cygwin g++ strictness

> From: Eric Blake
> 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).

That, or:
- Running your car's engineware.
- Exploding an airbag into your face on detecting a collisionware.
- Recording your vital signsware.
- Pumping insulin into youware.
- Doing your laundyware
- Computerized exercise machinewear
- Microwaveware
- A billion other products with 8- and 16-bit microcontrollers in themware.

CSci doesn't begin and end with the CPU currently on our desks!

>  You can probably 
> ignore the warning on 32-bit platforms, but the better fix is 
> to make your code portable by using <inttypes.h>.

Well, yeah.  There's always the option to not Do The Right Thing(tm), but my
personal experience is that correct way is usually also the easiest way.

Gary R. Van Sickle

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]