sizeof

Guy Harris guy at rlgvax.UUCP
Tue Feb 5 16:14:56 AEST 1985


> Of course, you can always work around sizeof(char *)!=sizeof(int *)
> (or sizeof(char *)!=sizeof(int)), but often it is a hassle, and
> it makes porting old (4.2BSD :-) source code very difficult.

Changing the implementation of, say, "getpwent" and the password file
can make porting programs that rummage through the password file directly
difficult.  This is NOT an argument against changing the implementation.
It is an argument against writing such programs in the future, and for
dedicating time to clean up those fossils if you make such a change.

The same applies to implementations of C on machines that don't encourage
the same sorts of laxity as "reasonable" machines do.  If expedience
is VERY important, you might consider doing the wrong thing; however,
I think you're better off biting the bullet and fixing the code (and
reporting fixes to AT&T, UCB, or whoever wrote it - maybe they'll take
the hint).  Think of it as doing a good deed for the next person who
has to move that software to a machine which isn't a warmed-over PDP-11.

	Guy Harris
	{seismo,ihnp4,allegra}!rlgvax!guy



More information about the Comp.lang.c mailing list