Sin Jeong-hun
2009-11-11 02:45:32 UTC
Hello.
At our company, we use preprocessor directives excessively for
conditional compilation. The language is not C, but we use Microsoft's
cl.exe just for preprocessing purposes. We mostly use simple #if,
#define or #ifdef. The problem is, we cannot, at least, check for
syntactical errors for all the possible codes that could be generated
after the preprocessing. Sometimes very simple syntactical errors such
as undeclared variables or mismatching control structures are found
later on.
I was thinking about writing my own C preprocessor to generate all
possible result codes, but as I am often told I don't need to reinvent
the wheel right? I thought the problem may also be true for general C/C
++, not only for our situation. Is it somehow possible to make the
cl.exe generate all possible preprocessed output?
At our company, we use preprocessor directives excessively for
conditional compilation. The language is not C, but we use Microsoft's
cl.exe just for preprocessing purposes. We mostly use simple #if,
#define or #ifdef. The problem is, we cannot, at least, check for
syntactical errors for all the possible codes that could be generated
after the preprocessing. Sometimes very simple syntactical errors such
as undeclared variables or mismatching control structures are found
later on.
I was thinking about writing my own C preprocessor to generate all
possible result codes, but as I am often told I don't need to reinvent
the wheel right? I thought the problem may also be true for general C/C
++, not only for our situation. Is it somehow possible to make the
cl.exe generate all possible preprocessed output?