Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!sdrc!scjones From: scjones@sdrc.UUCP (Larry Jones) Newsgroups: comp.std.c Subject: Re: Question about ANSI preprocessor Message-ID: <839@sdrc.UUCP> Date: 28 Sep 89 22:30:57 GMT References: <10879@riks.csl.sony.co.jp> Organization: Structural Dynamics Research Corp., Cincinnati Lines: 30 In article <10879@riks.csl.sony.co.jp>, diamond@csl.sony.co.jp (Norman Diamond) writes: > According to the ANSI standard, does the following code cause > expansion of the preprocessor macro "huh"? > > #define huh(x) (abc + (x)) > > y = huh > #if 0 > , a, lot, of, garbage > #endif > (z); No. Section 3.8.3 (Macro replacement) talks about function-like macros and says: Each subsequent instance of the function-like macro name followed by a ( as the next preprocessing token introduces the sequence of proprocessing tokens that is replaced by the replacement list in the definition (an invocation of the macro). In this case, the preprocessing token following the macro name is "#" rather than "(", so it is not eligable for expansion. ---- Larry Jones UUCP: uunet!sdrc!scjones SDRC scjones@SDRC.UU.NET 2000 Eastman Dr. BIX: ltl Milford, OH 45150-2789 AT&T: (513) 576-2070 "I have plenty of good sense. I just choose to ignore it." -Calvin