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

How to show 'preprocessed' code ignoring includes with GCC

$
0
0

I'd like to know if it's possible to output 'preprocessed' code wit gcc but 'ignoring' (not expanding) includes:

ES I got this main:

#include <stdio.h>#define prn(s) printf("this is a macro for printing a string: %s\n", s);int int(){char str[5] = "test"; prn(str);return 0;}

I run gcc -E main -o out.c

I got:

/*all stdio stuff*/int int(){char str[5] = "test";printf("this is a macro for printing a string: %s\n", str);return 0;}

I'd like to output only:

#include <stdio.h>int int(){char str[5] = "test";printf("this is a macro for printing a string: %s\n", str);return 0;}

or, at least, just

int int(){char str[5] = "test";printf("this is a macro for printing a string: %s\n", str);return 0;}

PS: would be great if possible to expand "local""" includes and not to expand "global"<> includes


Viewing all articles
Browse latest Browse all 22093

Trending Articles



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