On Portability

Guy Harris guy at auspex.UUCP
Thu Oct 27 06:23:44 AEST 1988


>Someone posted that we're dealing with two different definitions of
>portability here.  Yes, one could, in theory, expect that all
>compilers will comply with some standard, either the _de facto_ one
>presented in K&R, or the dpANS.  The fact remains that some do *not*,
>and there are a few easily identified areas where a *number* of
>compilers have trouble.

Let's hope here will be ANSI C test suites when the standard comes out,
so that in the future compilers that have trouble on these things will
be caught and, hopefully, fixed....

>	- It is unwise to depend on integer+pointer and its friends
>working correctly.  K&R is clear on this, if you read carefully;
>several compiler writers have not been so careful.

Do you mean "interger+pointer" as opposed to "pointer+integer"? 
Addition is generally commutative, and if a compiler can't handle
"pointer+integer", it is unwise to purchase that compiler;
"pointer+integer" is a quite widespread construct in C code.



More information about the Comp.lang.c mailing list