Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!batcomputer!munnari.oz.au!metro!otc!grahamd From: grahamd@otc.otca.oz.au (Graham Dumpleton) Newsgroups: comp.lang.c Subject: Expansion of macro arguments in ANSI cpp. Message-ID: <2610@otc.otca.oz> Date: 23 Apr 91 01:38:03 GMT Sender: news@otc.otca.oz Reply-To: grahamd@otc.otca.oz.au (Graham Dumpleton) Organization: OTC Development Unit, Australia Lines: 33 I checked the FAQ list but couldn't find this mentioned so: What is an ANSI conforming C preprocessor mean't to do in the following situation. #define preone onepre #define one two #define addpre(arg) pre##arg addpre(one) The preprocessor on a RS6000 running AIX when run with the argument '-qlanglvl=ansi' to invoke ANSI compatability produces onepre In other words it performs the join and then checks to see if the result is a macro and if so expands it. The pre-processor which we use though, which is based on the Decus cpp supplied on the X tape produces the following pretwo In other words it has the effect of expanding the argument if it is a macro first and then performing the join. I tend to think that the Decus cpp is wrong but can someone please confirm this. -- Graham Dumpleton (grahamd@otc.otca.oz.au)