Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
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!

List of 9 messages in thread
TopicAuthorDate
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      

Back to Subject List