Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!decvax!ima!mirror!frog!john From: john@frog.UUCP (John Woods) Newsgroups: comp.lang.c Subject: Re: C optimizer Message-ID: <1056@frog.UUCP> Date: 2 Mar 89 20:46:00 GMT References: <36662@think.UUCP> <453@lakart.UUCP> Organization: Misanthropes-R-Us Lines: 30 In article <453@lakart.UUCP>, dg@lakart.UUCP (David Goodenough) writes: O> From article <36662@think.UUCP>, by barmar@think.COM (Barry Margolin): O> ] In article <1028@frog.UUCP> john@frog.UUCP (John Woods) writes: P> ]>I think that if S> ]> (getpid() != getpid()) > ]>ever evaluated to 1, I would be severely astonished. O> ] Well, how about O> ] (pid = getpid(), (void) fork(), pid != getpid()) P> True - but I don't see any references to fork() in Mr.Woods' posting. S> What he is stating is that _IN THE ABSENCE_ of fork() calls, getpid() > had better return an unchanging value. No, what I was stating was that getpid() was a pure function. Pure functions are supposed to be pure functions even in the presense of other function calls. It is that property which allows them to be aggressively optimized. It is obvious that I was mistaken. As I have said to the first two people to point this out, oops. -- John Woods, Charles River Data Systems, Framingham MA, (508) 626-1101 ...!decvax!frog!john, john@frog.UUCP, ...!mit-eddie!jfw, jfw@eddie.mit.edu "He should be put in stocks in Lafeyette Square across from the White House and pelted with dead cats." - George F. Will