Path: utzoo!dciem!array!colin From: colin@array.UUCP (Colin Plumb) Newsgroups: comp.lang.c Subject: Re: Can va_arg() be used as an lvalue? Message-ID: <420@array.UUCP> Date: 4 Aug 90 23:52:59 GMT References: <1990Aug3.091749.10018@hellgate.utah.edu> Organization: Array Systems Computing, Inc., Toronto, Ontario, CANADA Lines: 20 In article <1990Aug3.091749.10018@hellgate.utah.edu> sandra%jensen.utah.edu@cs.utah.edu (Sandra Loosemore) writes: > Specifically, can I take the address of its >return value? It looks like it will work in the C implementations I >currently have access to, but I'm not sure whether that's a bug or >a feature. Section 4.8.1.2: "The va_arg macro expands to an expression that has the type and value of the next argument in the call." In particular, not necessarily an lvalue, just a general expression. Arguments need not be passed in addressible storage (registers are possible), so taking the address is not guaranteed. (Yes, most current compilers copy the arguments into memory so they can refer to them from called procedures that are passed the va_list, but a really intelligent compiler might do that only if the va_list is passed to a called procedure, or something trickier.) -- -Colin