4 ms·
Printing the contents of a C macro
- vog 12y agoGreat trick! Didn't know about this. This may be handy for debugging C macros, as an alternative to run the preprocessor by hand over the whole source just to see the expansion of a single macro.
- billconan 12y agoThis is so great! I wanted this since forever. That's been said, shouldn't this be a compiler feature? print out macro at compile time for easy debugging?
- BruceIV 12y ago`gcc -E foo.c` will just run the pre-processor and print to stdout (including expanding all the `#include`s, so it's a bit verbose).