How to catch undefined preprocessor macro with gcc?
问题 I've been working on a piece of code that had an overlooked derp in it: #include<stdio.h> #include<stdlib.h> #include<limits.h> #define MAX_N_LENGTH /*function prototypes*/ int main(){ ... } It should be easy to spot with the context removed: #define MAX_N_LENGTH should have read #define MAX_N_LENGTH 9 . I have no idea where that trailing constant went. Since that macro was only used in one place in the form of char buf[ MAX_N_LENGTH + 1] , it was extremely difficult to track down and debug