Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!decwrl!decvax!ima!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.std.c Subject: Re: Variable arguments in macros Message-ID: <12839@haddock.ima.isc.com> Date: 28 Apr 89 00:21:14 GMT References: <58345@yale-celray.yale.UUCP> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Boston Lines: 13 In article <58345@yale-celray.yale.UUCP> leichter@CS.YALE.EDU (Jerry Leichter (LEICHTER-JERRY@CS.YALE.EDU)) writes: >[allow an ellipsis in the macro parameters, and have a builtin macro _REST_ >which] expands to the list of remaining arguments, including a leading comma >if there is at least one such argument. Not good enough. Consider: #define f(a,b,...) (g(a,b),h(_REST_)) in which, for syntactic correctness, _REST_ must exclude the leading comma. I suspect this was the major reason that variadic macros didn't make it into the Standard: there was no clean proposal that handled the case with zero additional args. Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint