Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^4: C macro pre processing

by afoken (Abbot)
on Jun 24, 2012 at 07:59 UTC ( #978043=note: print w/replies, xml ) Need Help??


in reply to Re^3: C macro pre processing
in thread C macro pre processing

unifdef looks promising.

Update:

The current unifdef-2.6 does not process the #defines included from types.h, so for the trivial command unifdef types.c -o output.txt, the output is unchanged.

Using the brain to parse types.h, one can define ALPHA, BETA, and GAMMA via the command line: unifdef -DALPHA=1 -DBETA -DGAMMA=0 types.c -o output.txt, but unfortunately, this removes all preprocessor commands, not only the GAMMA commands.

So, to get rid of only the GAMMA commands, one has to define only GAMMA on the command line: unifdef -DGAMMA=0 types.c -o output.txt. This gives the expected result.

Update 2:

unifdef seems to completely ignore #include and #define. So, types.h is not read at all, and even if it would be read, the #defines have no effect.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://978043]
help
Chatterbox?
[Eily]: and my point was, he met some monks yesterday in Italy who offered him a place for the night
[Eily]: and since he was meating eatalian monks I wondered if I should tell him to say hi to Discipulus for me :D
[erix]: Nancy-Bari: 1320 km ... He'll need some time :)
[LanX]: he was "meating" Italian monks oO?
[erix]: then again, there are people who do 10 full triathlons on 10 consecutive days, so it must be doable
choroba's friend has done the Pacific Crest Trail, it's 4200 km
LanX Ladies and gentlemen: due to shortages of "Body of Christ" we have to resort to Body of Monks ...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2017-12-13 15:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (369 votes). Check out past polls.

    Notices?