From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1014db,4873305131bf4d94 X-Google-Attributes: gid1014db,public X-Google-Thread: 103376,4873305131bf4d94 X-Google-Attributes: gid103376,public From: ohk@tfdt-o.nta.no (Ole-Hjalmar Kristensen FOU.TD/DELAB) Subject: Re: Porting (was ADA and Pascal etc) Date: 1997/10/31 Message-ID: #1/1 X-Deja-AN: 286174398 References: <34557f2b.1934172@news.mindspring.com> <34566fe9.447229@news.mindspring.com> <345673af.1413708@news.mindspring.com> <3456b9f3.0@news.eznet.net> <3456e71b.3833189@news.mindspring.com> <3459AC95.1D75@dynamite.com.au> <63bhta$g2e@bgtnsc03.worldnet.att.net> <345AB871.413A@dynamite.com.au> Organization: Telenor Online Public Access Newsgroups: comp.lang.ada,comp.lang.c Date: 1997-10-31T00:00:00+00:00 List-Id: Alan E & Carmel J Brain writes: > Craig Franck wrote: > > > > Jon S Anthony wrote: > > >Alan E & Carmel J Brain writes: > > > > > >> C and C++ compilers differ by so much that porting is often a Nightmare. > > >> Before I get flamed, I'd like to talk to people who've actually ported > > >> code cross-platform. > > > > > >That's about right. Porting anything of substance written in C even > > >between compilers on the _same_ platform is depressing. FOE here... > > > > Sounds like you may have been a victim of the run of your patients. > > Well written C code is very portable. I've seen compiler upgrades > > break code, but only because it was trash to begin with. > > May I respectfully offer a counterexample? > Code Warrior accepts > > void Main() > { > for (int i ; i < SomeValue ; i++ ) > { > // Do something > } > > for (int i ; i < SomeOtherValue ; i++ ) > { > // Do something else > } > } > > As by one reading of the (yet-to-be-standardised C++ spec) the scope of > each > i is limited to reside within the parens {} of each loop. > > Yet MVC++ 5 barfs: as the scope of i is deemed to be within the main > program, so the two int i declarations clash. > > I do not consider the above code to be "trash". If you do, please > elucidate as to why (heck, I could be wrong, have been before, will be > again) Note that he says C code, not C++. > aebrain@dynamite.com.au <> <> How doth the little Crocodile > | Alan & Carmel Brain| xxxxx Improve his shining tail? > | Canberra Australia | xxxxxHxHxxxxxx _MMMMMMMMM_MMMMMMMMM > abrain@cs.adfa.oz.au o OO*O^^^^O*OO o oo oo oo oo > By pulling MAERKLIN Wagons, in 1/220 Scale