Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22122

GCC Preprocessor how to replace #define with empty line

$
0
0

I'm trying to use the GCC Preprocessor with Javascript source code.

I would like achieve the output below from this input:

Line 1 
Line 2 #define ASDF 'asdf'
Line 3
Line 4 var asdf = ASDF

Output:

Line 1 
Line 2 
Line 3 
Line 4 var asdf = 'asdf'

How could I achieve the above?

So far I have tried:

/usr/bin/cpp -P -undef -Wundef -std=c99 -nostdinc -Wtrigraphs -fdollars-in-identifiers -traditional-cpp -E -C $INFILE -o $OUTFILE

The -traditional-cpp preserves whitespace, and the -E preserves comments.

Is it possible to replace all lines with preprocessor directives with empty lines?


Viewing all articles
Browse latest Browse all 22122

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>