We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
there are compile errors in the following two function declaration. void CAN_SETTXBID(unsigned char node,unsigned char type); int CAN_SETFILTER(unsigned char node); they both have the following compile error: error C141: syntax error near '0' but there are no '0' in these two function declaration,so i can't figure out where the '0' come from,and how should i correct these codes?
Well, type is a 'C' reserved word, isn't it!?
"type is a 'C' reserved word, isn't it!? " I think you're thinking of 'typedef'. Stefan
or maybe Pascal??
"or maybe Pascal??" Who?
Could the '0' be coming from the preprocessor? Look at the *.i file.
i don't have .i file in my project. my keil is runing on simplified chinese version windowsXP,does that could be a cause?
"i don't have .i file in my project" Go to "Options for target" -> "Listing" and you can turn on the preprocessor listing file, map file output etc. "my keil is runing on simplified chinese version windowsXP,does that could be a cause?" I doubt it, but anything's possible with windows. It sounds much more as though you have a syntax error somewhere else in your program (maybe a missing semicolon or curly brace) which is causing the subsequent code to be taken out of context. Why don't you reverse the changes you made before this error occurred then reintroduce them one by one until the error reappears? This should let you discover what is causing it. Stefan
http://www.8052.com/forum/read.phtml?id=54536
Check your Font. In Keil's BadCode example, the 'O' and the zero appear identical just to pint out this type of error.
i have found the cause of this error. i have define node as 0 in one of my files using #define node 0 after i delete this define ,every thing is ok
You've just found one of many reasons behind the C traditions of making #defined constants UPPER_CASE --- it's a lot less likely that collisions like this will happen if you follow it.