printf() problem

Stephen J. Friedl friedl at vsi.COM
Sat Apr 29 01:04:33 AEST 1989


[talking about why printf() "rearranges" the order of its arguments]

In article <2679 at buengc.BU.EDU>, bph at buengc.BU.EDU (Blair P. Houghton) writes:
> 
> If there are compilers that do it the other way (FIFO stack for args),
> I don't know about them.  You're best bet, however, is not to trust
> the order of evaluation of arguments, regardless.

Actually, they're all FIFO stacks.

It's been my observation that args are evaluated right-to-left on
machines where the stack grows down and left-to-right if the stack
grows up.  The WE32100 (AT&T 3B2) and I think the PDP-11 all have
an up-growing stack, and they operate this way. 

I don't know if it's a cause-and-effect relationship, but once
I studied this and it seemed plausible guess.

    Steve

P.S. - A *FIFO* stack?

-- 
Stephen J. Friedl / V-Systems, Inc. / Santa Ana, CA / +1 714 545 6442 
3B2-kind-of-guy   / friedl at vsi.com  / {attmail, uunet, etc}!vsi!friedl

As long as Bush is in office, you'll never see Nancy Reagan in *my* .sig.



More information about the Comp.lang.c mailing list