Mail Archives: djgpp/1994/10/09/19:12:49
... stuff deleted for brevity ...
> This is simply not true! A TRUE 32 bit compiler is 32-bits throughout,
> instead of using 16 or 32 bits here and there. This is a major
> complaint of users of Borland and Microsoft compilers that are touted to
> be 32-bit compilers where they don't use 32-bits for their integers.
Yup. very very true. Borland==Microjunk==junk. 8)
... stuff deleted for brevity ...
> As far as Unix programs and such are concerned, what's wrong with
> assuming that the size of an int is the same as the size of a pointer?
Well, for one, it's not necessarily true. For instance, on my DEC Alpha,
sizeof(int)=4, sizeof(int *)=8
> This is almost a given in the C programming world, or at least is should
> be. I conceed that assuming the length of any pointer is bad programming
> practice -- and, in general, assuming the byte ordering of any "pointer"
> or "int" type is bad programming practice; but for those programs (device
> drivers / kernels) that require a low-level understanding of the
> architecure[sp] that it is running on, what else are the programs to
> assume? There is a certain level of non-portability in every program, it
> just depends on what the program is designed to accomplish as to how
> non-portable it is.
They should assume that a pointer is a pointer, and its size is "pointer size".
You just can't make these assumptions and expect your programs to work
on any machine.... Too many people grew up on just 1 or 2 platforms, and
generalize bad assumptions, and I've had too many times where I've had to
fix their stuff on my systems. arrgh! ;)
... more stuff deleted for brevity ...
Ah well, just my 2c worth'..
-- Idan
- Raw text -