lint, pointers, 0 (what else?)

mwm at ucbtopaz.CC.Berkeley.ARPA mwm at ucbtopaz.CC.Berkeley.ARPA
Tue Feb 26 14:17:20 AEST 1985


In article <8567 at brl-tgr.ARPA> gwyn at brl-tgr.ARPA (Doug Gwyn <gwyn>) writes:
>> The result of using this system is that you know your programs will get
>> enough space on strange hardware. If it needs things that are too big, it
>> won't compile.
>I think this is backwards.  How about writing your code in terms of
>parameters describing the system (such as those in <limits.h>), rather
>than writing code that does not work on systems having perfectly
>reasonable arithmetic properties that just don't happen to be what
>you had when you wrote the code.

No, that is forwards. If your code needs 34 bit ints, and the system your are
trying to compile it on doesn't support ints that are >= 34 bits in length,
then it isn't going to run. Why bother letting it compile in that case?
Especially when the compile time errors will point to the variables that
cause the problem?

BTW, can I use <limits.h> (we don't seem to have one) to correctly put a
variable that needs 9 bits in a char on a C/70, and in a short on a VAX?

	<mike



More information about the Comp.lang.c mailing list