-
-
Notifications
You must be signed in to change notification settings - Fork 7k
#define c bug in compilation #1735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
My first guess is that the #include <Arduino.h> is inserted by the compiler after your #define, which makes every c in the ARduino header files replaced by 42. I think the proper solution would be to "Just don't do that, then..." |
That might be the proper solution, but I think that it should at least be documented. Additionally, it would be helpful to find out what else might break things like |
It is documented here: http://en.wikipedia.org/wiki/C_preprocessor For any person with some experience writing C/C++ code adding "#define c whatever" to any c/c++ code is like driving drunk:
|
We agree that someone is drunk here, and please leave the driver's seat. |
I think "c" chars get replaced only if they are identified as single tokens
|
It used to be a simple find and replace but nowadays it is a token find and replace. Anyways even with the token replacement all these will not work
|
just for the fun of it here are the "bad" single small case chars giving problems |
@polettix do you think we may close this issue? |
@ffissore sincerely I don't think. It seems that this is something happening due to some "auto-magic" insertion of stuff in the beginning of the code, but I haven't seen any reference in the docs. If there is no way to avoid this error, I think it might be at least useful to document it. Of course this is only my opinion! :-) Ciao. |
Please checkout this thread [1] on devs mailing list and try one of the linked IDEs. It should fix the problems reported in this issue |
I'll take a look and provide some feedback. Thanks for caring! 2015-01-21 11:04 GMT+01:00 Federico Fissore [email protected]:
|
@polettix are there any news about this? |
This simple program fails to compile in the 1.0.5 IDE:
I saw that the problem is with the
c
, nothing wrong happens using another token liked
orlife
. Additionally, compilation is fine if there is a statement before the define, like in the following:I got the error while trying to compile the first sketch in http://www.arduino.cc/en/Tutorial/PlayMelody
The text was updated successfully, but these errors were encountered: