Mail Archives: djgpp/1999/05/13/19:52:22
Shawn Hargreaves wrote:
> Personally, though, I've never much liked this method of defining
> your own types. As long as you make some minimal assumptions (eg.
> that you can fit at least 32 bits in an int, or assume at least 16
> bits if you want to support 16 platforms as well), and don't rely
> on any specific wrapping behaviour, I've never found a case where
> I really needed this kind of define. IMHO it is almost always
> better to let the compiler choose a good size for you, eg. if
> you naively ported a 16 bit DOS program to djgpp by defining all
> the integers as shorts, you'd end up with very inefficient code
> because of all the size prefixes, wheras if you just said "int"
> you would get whatever is the optimal integer datatype for the
> current machine.
What happens when you need to have a program load a file with a struct
stored on it? If you just let the compiler choose the "optimal" size of an
int, then you get screwed because the struct won't load correctly.
--
(\/) Endlisnis (\/)
s257m AT unb DOT ca
Endlisnis AT HotMail DOT com
ICQ: 32959047
- Raw text -