Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!orchid!rbutterworth From: rbutterworth@orchid.UUCP Newsgroups: comp.lang.c Subject: Re: ANS C Macro Processing Message-ID: <11455@orchid.waterloo.edu> Date: Fri, 30-Oct-87 09:28:24 EST Article-I.D.: orchid.11455 Posted: Fri Oct 30 09:28:24 1987 Date-Received: Sat, 31-Oct-87 12:16:57 EST References: <167@sdti.UUCP> <11322@orchid.waterloo.edu> <1880@homxc.UUCP> <11446@orchid.waterloo.edu> Organization: U of Waterloo, Ontario Lines: 26 In article <11446@orchid.waterloo.edu>, jagardner@orchid.waterloo.edu (Jim Gardner) writes: > In article <1880@homxc.UUCP> lewisd@homxc.UUCP (David Lewis) writes: > > How do you determine what the pre-processor expands a macro to be? > > Is there any way to take a look at the results of such an expansion? > > Can you see the intermediate file produced after all #includes and > > #ifdefs and #defines are evaluated? > I'm not sure exactly what you mean. One way to see what CPP expands a macro > to be is to run a source file with the macro in it through CPP and look at > the output. In some environments this involves either invoking C with > appropriate arguments or calling the cpp pass directly. Another way > is to carefully read the dpANS C section on CPP and pretend you're it. > The latter will place your sanity in jeopardy. > > David Tanguay, Software Development Group, University of Waterloo But ANSI only defines how the compiler in total will work. It says nothing about the existence of a separate CPP program or a compiler option that will show the preprocessed output. I don't think it is hard to imagine a compiler that does the preprocessing as part of the compilation itself and not as a separate step. For instance, consider the ANSI compiler produced by the Software Development Group (i.e. you). It comes without a CPP and and I don't see any option mentioned in the expl file for the compiler that would produce CPP-like output.