blufox said:
I read somewhere that standard Ansi C on 32 bit architecures assumes a
lot of things which lead to poor code.
"Ansi C on 32 bit architectures" doesn't really mean a great deal. If you
mean "programs supposedly written in ANSI C but relying in practice on
non-portable assumptions that happen to be true on the development
platform", then that is indeed meaningful.
For example
sizeof( int ) = sizeof( void * )
sizeof( long ) = sizeof( int )
Why is this poor code?
If sizeof(int) is not the same as sizeof(void *), then it's a bad idea to
assume it is. And of course the same applies to your second example.
Even if these assumptions happen to be true on the machine we are working on
today, they might not be true on the machine the boss suddenly decides to
buy tomorrow. And since he's spent all that money on supposedly portable C
programs, he's going to want to run those programs on that machine,
tomorrow. Writing the programs correctly in the first place is far easier
than explaining to your boss why you didn't.