gcc – how to see expanded macros

Sometimes it can be useful to see how expanded c macros. In gcc for this purpose there is the option -E (Preprocess only; do not compile, assemble or link).

gcc -E main.c > out.txt

After executing above command, main.cpp will be processed by preprocessor and it output will be forwarded to out.txt, that you can read and see how was expanded your macros.

sources of information
source visit date
seeing-expanded-c-macros 2015.10.03

Leave a Reply

Your email address will not be published. Required fields are marked *