Path: utzoo!yunexus!geac!syntron!jtsv16!uunet!ateng!chip From: chip@ateng.ateng.com (Chip Salzenberg) Newsgroups: comp.lang.c Subject: Re: Portability of passing/operating on structures... Message-ID: <1988Oct24.172209.27031@ateng.ateng.com> Date: 24 Oct 88 21:22:08 GMT Article-I.D.: ateng.1988Oct24.172209.27031 References: <8810111934.AA21941@ucbarpa.Berkeley.EDU> <8308@alice.UUCP> <23933@wlbr.EATON.COM> <1988Oct19.192548.28438@ateng.ateng.com> <35 Organization: A T Engineering, Tampa, FL Lines: 31 According to g-rh@XAIT.Xerox.COM (Richard Harter): > Yes, I pander to broken compilers. I have to. If I must work with a specific broken compiler, then I do the same: pay for play has its own rules. I was, of course, referring to situations where there *is* a choice, such as when writing free software, in which case I don't worry about it. > And the truth of the matter is that there is no penalty for >writing portable code [...] But there *is* a penalty in pandering to broken compilers. If, for example, a compiler breaks on: foo(s) short s; { short *sp = &s; int i = *sp; printf("%d\n", i); } Then you have to invest time and effort into avoiding a language construct -- taking the address of a function parameter -- that should have worked. (I know that some compilers do, in fact, break this contruct.) I'm sure all will agree that spent time and effort are just as much a "penalty" as execution time. -- Chip Salzenberg or A T Engineering Me? Speak for my company? Surely you jest! Beware of programmers carrying screwdrivers.