Mail Archives: djgpp/1997/10/17/05:28:24
At 18.05 1997-10-16 +0000, you wrote:
>Peter Palotas wrote:
>>
>> Well, no, this was not the problem. The problem was (as it showed a little
>> later) that all I wanted was for CPP to process the #include "file.h"
>> statements, and leave all the others. Now I created two AWK programs which
>> solved this problem. But thanks anyway!
>
>Oh, I see. Well, gcc does have an option to stop compilation after the
>preprocessor stage. It then outputs the preprocessed code to stdout, so
>you can capture it and place it in a file. The switch is -E, I
>believe. You could use this to write a tiny program that does nothing
>but include the header file, and then view the results.
Thanx, I was wondering if there was such a switch too, but it really was
not my problem. (You can write "cpp test.c > test.i" too, although you
don't get the definitions that GCC normally provides (DJGPP, __MSDOS__ and
so on).
My PROBLEM was that in the below file, if we add a line #include <stdio.h>
I did NOT want that line to be preprocessed. *only* #include "" statements
should be preprocessed, and all #defines and such left alone.
>----- test.c -----
>
>#include "file.h"
>
>------------------
>
>gcc -E test.c > test.i
-- Peter Palotas alias Blizzar -- blizzar AT hem1 DOT passagen DOT se --
*****************************************************
* A brief description of DJGPP: *
* NEVER BEFORE HAS SO FEW DONE SO MUCH FOR SO MANY! *
*****************************************************
- Raw text -