![]() |
calling gcc cpp functionality programmatically
Hi,
Does anyone know how to call gcc cpp functionality in a program so that the preprocessed output is directed to a memory location rather than a file? |
The easiest way I can think of is to essentially call
Code:
system("gcc -E -o output.i input.c");John G |
'gcc' preprocessor by default outputs to STDOUT, so it's a matter of 'popen' and friends.
|
Quote:
|
Quote:
Code:
-E Stop after the preprocessing stage; do not run the compiler proper. |
| All times are GMT -5. The time now is 02:59 AM. |