"#if sizeof(char *) < sizeof(int)"

H.MORRIS hom at hocda.UUCP
Wed Feb 8 01:51:28 AEST 1984


In writing code for an interpreter and similar projects, I have
often gnashed my teeth over the fact that you can't make a statement
like
#if sizeof(char *) > sizeof(int)
or
#if sizeof(int) == sizeof(long)
It would go a long way towards making it possible to write certain
difficult code to be portable over a reasonable class of machines
(Lets say we forget about DEC-10s and Harris/6's, etc.).  Since we
can't do such things we certain programs (like loaders) riddled
with references to particular machines where it really isn't necessary.
	I realize, I think that the problem is maintaining pcc with
(virtually?) no machine dependencies (so the same pcc is used for
a cross-compiler as for the host machine - at least I've see that happen).
Now there's talk of pcc being less "dumb"; i.e. "knowing" more about
C and/or the particular target machine.  If done right, looks like
that could be a very positive step.  One should also have an unbundled
pcc CAPABILITY somewhere.  I'm not sure but what m4 has too many
bells and whistles added.



More information about the Comp.lang.c mailing list