Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!wuarchive!zaphod.mps.ohio-state.edu!rpi!leah!bingvaxu!vu0310 From: vu0310@bingvaxu.cc.binghamton.edu (R. Kym Horsell) Newsgroups: comp.lang.c Subject: Re: Preprocessor macro to quote its argument Message-ID: <3866@bingvaxu.cc.binghamton.edu> Date: 20 Aug 90 07:49:42 GMT References: <1112@mti.mti.com> <3857@bingvaxu.cc.binghamton.edu> <1990Aug19.200440.8534@uunet!unhd> Reply-To: vu0310@bingvaxu.cc.binghamton.edu.cc.binghamton.edu (R. Kym Horsell) Organization: SUNY Binghamton, NY Lines: 23 In article <1990Aug19.200440.8534@uunet!unhd> al@unhd.UUCP (Anthony Lapadula) writes: \\\ >What happens if Q is ``invoked'' with another macro as its argument, as in: > #define M1 100 > #define M2 func() > : > puts (Q(M1)); > puts (Q(M2)); > >What should the output be? The two compilers available to me disagree. > gcc version 1.37.1 ---> outputs "M1" and "M2" > cc ---> CPP error ("#100 undefined [in puts(#100)]) The #x in a macro is supposed to produce an ascii string if its argument "x". Since rescanning occurs *after* this process and ANSII C isn't *supposed* to look inside strings you should get what gcc gave you. It sounds like your cc dosn't comply with the std. -Kym Horsell