C optimizer

David Goodenough dg at lakart.UUCP
Wed Mar 1 03:02:35 AEST 1989


>From article <36662 at think.UUCP>, by barmar at think.COM (Barry Margolin):
] In article <1028 at frog.UUCP> john at frog.UUCP (John Woods) writes:
]>I think that if
]>	(getpid() != getpid())
]>ever evaluated to 1, I would be severely astonished.
] 
] Well, how about
] 
] 	(pid = getpid(), (void) fork(), pid != getpid())
] 
] ?  It will evaluate to 0 in the parent process, 1 in the child
] process.

True - but I don't see any references to fork() in Mr.Woods' posting.
What he is stating is that _IN THE ABSENCE_ of fork() calls, getpid()
had better return an unchanging value.
-- 
	dg at lakart.UUCP - David Goodenough		+---+
						IHS	| +-+-+
	....... !harvard!xait!lakart!dg			+-+-+ |
AKA:	dg%lakart.uucp at xait.xerox.com		  	  +---+



More information about the Comp.lang.c mailing list