Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!brutus.cs.uiuc.edu!ux1.cso.uiuc.edu!tank!mimsy!chris From: chris@mimsy.umd.edu (Chris Torek) Newsgroups: comp.lang.c Subject: Re: ANSI C stdarg questions Keywords: stdarg ANSI C Message-ID: <21387@mimsy.umd.edu> Date: 21 Dec 89 09:39:08 GMT References: <8217@pixar.UUCP> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 20 In article <8217@pixar.UUCP> rta@pixar.UUCP (Rick Ace) writes: >1) Is it legal ANSI C for test() to pass the argument "ap" to > print1() and print2() as it does in the above program [deleted]? Yes. Unfortunately, it is not legal afterwards to do more with `ap' in test(). >2) Is it legal ANSI C to traverse the argument list multiple times? >[using va_start + series of va_arg + va_end + va_start + va_arg + va_end] Yes, this is explicitly allowed. As you noted, the only real problem is the obnoxious (and completely unnecessary, since the `...' syntax must be recognised by the compiler and therefore compilers could recognise some other hidden syntax for va_start's expansion) requirement for an `anchor' (the `x' in your `test'). -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@cs.umd.edu Path: uunet!mimsy!chris