Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!labrea!aurora!eos!ames!hao!scdpyr!cruff From: cruff@scdpyr.UUCP (Craig Ruff) Newsgroups: comp.arch Subject: Re: RISC is a nasty no-no! Message-ID: <284@scdpyr.UUCP> Date: 28 Feb 88 05:18:29 GMT References: <179@wsccs.UUCP> <696@nuchat.UUCP> Reply-To: cruff@scdpyr.UUCP (Craig Ruff) Organization: Natl Ctr Atmospheric Research, Boulder, CO Lines: 33 In article <696@nuchat.UUCP> steve@nuchat.UUCP (Steve Nuchia) writes: >From article <179@wsccs.UUCP>, by terry@wsccs.UUCP (terry): >[ lots of self-congratulation about how portable his code is, followed > by complaints that it isn't portable to the SPARC ] > >> THE REASON: Type-casting. You can't. > >FLAME ON! ( I love this! ) > >WRONG. It is demonstrably NON-portable code - it failed to port >to a working compiler on a reasonable machine. If the bloody >unix kernel runs (and it does) your silly application should, too. > >FLAME OFF. I've just ported several thousand lines of code to the Sun-4. The only problem I had was in the use of the ndbm library. I was doing a structure copy with the dptr result from dbm_fetch, which turned out to be non-word aligned. Of course the documentation does not state that the dptr will be word aligned, in fact, it doesn't state anything at all about this. Anyway, type casts do exist in this code, though in small numbers. Since I knew this code would eventually reside on the Sun-4, I was careful to write it with portability in mind. I also ported many more thousand lines of both C (written with Unix portability in mind) and Fortran (gak! written with many-vendor machine portability in mind). Not one single problem related to data alignment or casting. In all, I'd say that the Sun-4 does not present any unsolvable problems in porting code. If your code is really portable that is. :-) -- Craig Ruff NCAR INTERNET: cruff@scdpyr.UCAR.EDU (303) 497-1211 P.O. Box 3000 CSNET: cruff@ncar.CSNET Boulder, CO 80307 UUCP: cruff@scdpyr.UUCP