C's Limited Macro Capabilities

Richard Brittain richard at calvin.EE.CORNELL.EDU
Mon Dec 4 14:42:14 AEST 1989


In article <11250 at csli.Stanford.EDU> poser at csli.stanford.edu (Bill Poser) writes:
>
>A simple macro processor, like the one we have, is a Good Thing.
>I am not so sure that a more powerful macro processor along the
>same lines would be. For one thing, the syntax of macro languages
>is nasty, and not conducive to good programming practice, and when one
>writes complex macros, in effect one is making use of a meta-programming
>language. So my gut reaction to proposals for non-trivial extensions to
>cpp is generally one of the following, depending on the case at hand:
..... examples deleted

Another problem with using complex macros, particularly if they affect function
declarations or variable/array declarations, is that most source code analysis
tools, pretty printers etc. will break.  Running them on the output of cpp
doesn't cut it if part of the output involves line numbers into the source file.


Richard Brittain,                   School of Elect. Eng.,  Upson Hall   
                                    Cornell University, Ithaca, NY 14853
ARPA: richard at calvin.spp.cornell.edu	
UUCP: {uunet,uw-beaver,rochester,cmcl2}!cornell!calvin!richard



More information about the Comp.lang.c mailing list