GCC: Preview all declared directives in included header

To preview what preprocessor’s directives is declared in included header you can use gcc flag -dM -E

For example, to print out all errno values run:

# echo '#include ' | gcc -E -dM -x c - \ | grep '^#define E.*' | sort -k 3 -n


Leave a Reply

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