cpp replaced by m4?

Steven W. Orr steveo at syslang.net
Tue Jul 3 11:31:03 EDT 2007


On Tuesday, Jul 3rd 2007 at 09:52 -0400, quoth Thomas Charron:

=>On 7/2/07, Steven W. Orr <steveo at syslang.net> wrote:
=>> On Mon, 2 Jul 2007 16:34:45 -0400 (EDT)
=>> "Steven W. Orr" <steveo at syslang.net> wrote:
=>> I got that part. What I want to know is if anyone else has satisfied a
=>> need for a more featureful preprocessor in their C code, whether it be via
=>> use of m4 or something else. Whatever is used, I'd like to see if there is
=>> any setup to save me any of the work of figuring out how to use it. I
=>> don't care about ISO or platform dependance. Preferably, I'd like to run
=>> my replacement first and then maybe process the output of that as regular
=>> C code.
=>
=> Can we have an example of why you want to do this?

Sure. For starters, one thing that we're looking to do:

Loops.

int *arr[]() = {
#for ii in l1 l2 l3 l4 etc
#do
    func##cpp_eval(ii),
#done
    };

Another would be much more complicated to describe, but involves being 
able to get access to individual arguments of variadic macros one at a 
time to compute what the macro should produce as output.

Is this description of any use?

-- 
Time flies like the wind. Fruit flies like a banana. Stranger things have  .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net


More information about the gnhlug-discuss mailing list