Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!sgi!bam@rudedog.SGI.COM From: bam@rudedog.SGI.COM (Brian McClendon) Newsgroups: comp.sys.atari.st Subject: Re: A Lesson Learned Summary: not MWC or the ST's fault Message-ID: <29079@sgi.SGI.COM> Date: 21 Mar 89 02:41:31 GMT References: <8903202254.AA00303@icase.edu> Sender: daemon@sgi.SGI.COM Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 27 In article <8903202254.AA00303@icase.edu>, csrobe@ICASE.EDU (Charles S. [Chip] Roberson) writes: [stuff deleted] > fprintf( stderr, isprint(*cp)? "[%c]":"[%02x]", *cp++ ); [stuff deleted] > The moral of this story? Well, as my Theory of Prog. Lang prof would > say, "That's just another insecurity of C!"; to which he would add > "Ada is a much better language." Well, I guess I would say > "Hey! Be careful out there." > > Seriously, this is one side-effect that I hadn't thought about. How > do other ST compiler's pass their parameters? So much for portability, > eh? Does anybody know how the dpANS standard would affect this, if at > all? I can't seem to remember anything in it that would. > This isn't a problem with MWC. There is no definition of what order arguments are "executed" in the C bible (K&R) that I could find. While the fprintf(...) is slick code, it is also machine-dependent and VERY un-portable (I think the Clipper (RISC) compiler also executes parameters backwards). -- - brian -------------------------------------------------------------------------- Brian McClendon bam@rudedog.SGI.COM ...!uunet!sgi!rudedog!bam 415-335-1110 --------------------------------------------------------------------------