C Review

Guy Harris guy%gorodish at Sun.COM
Wed Jan 21 05:49:34 AEST 1987


> People who have Intel 80x86 based Unix micros (such as Xenix and Microport)
> are actually *more* aware than you 68000 types about portability concerns.
> We are the ones who get bitten when someone assumes sizeof(int)=sizeof(long),

Wrongo.  Some 68K implementations have 16-bit "int"s and 32-bit pointers and
"long"s; those of us who have worked on such implementations are quite aware
of this.

> >It's taken about 6 months to get a version of "arc" (written in C for
> >msdos) to run semi-reliably on machines with different byte order,
> >different order of execution, or different word sizes than the 8088.
> 
> As a person who ported the recently posted Unix arc sources to Xenix,
> let me assure you that many of the portability problems were introduced
> by the Unix guru who ported arc to Unix (on a 68000 based micro no less)

It seems doubtful that problems in porting "arc" to a non-808* machine were
caused by its port to a 68K-based machine!

My own favorite "worst architecture/C implementation" for encouraging
non-portable code is VAX UNIX's, but so what?  There is a distressing
tendency amongst C programmers on *all* implementations to write
non-portable code when with little or no extra effort, and little or no cost
in efficiency, they could write the same code portably.  Trying to pin the
blame on one particular machine or on one particular C implementation on
that machine is pointless.



More information about the Comp.lang.c mailing list