??? 09/13/02 21:55 Read: times |
#29152 - Debugging preprocessor problems |
Dan has already identified that the problem is due to the semicolon in #define reset 0xe1;#defines are used by the 'C' Preprocessor; effectively, this takes your source file, processes it, and then passes the result to the Compiler. With the above #define, whenever the preprocessor sees "reset" it replaces it with "0xe1;" so your line test(reset);becomes test(0xe1;);and the error is now obvious! Now here is Andy's Handy Hint for Debugging Preprocessor Problems: Most compilers provide a facility to save the Preprocessor output to a file; with Keil C51, it's the PREPRINT command-line option. Conventionally, this creates a file with a .i extension. If you have unexplained errors, or suspect that your macros might not be quite working properly, I recommend that you should check this preprocessor listing! |
Topic | Author | Date |
Passing parameters | 01/01/70 00:00 | |
RE: Passing parameters | 01/01/70 00:00 | |
RE: Passing parameters | 01/01/70 00:00 | |
RE: Passing parameters | 01/01/70 00:00 | |
RE: Passing parameters | 01/01/70 00:00 | |
RE: Passing parameters | 01/01/70 00:00 | |
Debugging preprocessor problems | 01/01/70 00:00 | |
RE: Debugging preprocessor problems | 01/01/70 00:00 | |
RE: lint![]() | 01/01/70 00:00 |