-
-
Notifications
You must be signed in to change notification settings - Fork 7k
transformation .ino to .cpp fails with multi-line macro definition #1971
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
Are you trying to define abc as \0 (null char) or are you defining the value of abc on a new line on purpose? |
This is a reduction of an example that was much more complicated to the minimum required to illustrate the bug. In the original code, the expression the macro expands to was more complex, and the resulting define did not fit on a single line. Hence, I wrote it with the continuation. My workaround is to tolerate the overly long line and not use continuation to make it easily legible. Peter Olson |
Please give a try to the IDEs linked at the bottom of this email on the dev list
|
Tested using the Linux 64 bit version. Works fine, thanks! Will the issue with newlines be fixed? I have been writing all my function Peter Olson
|
Problem is with ctags: it reports where the function name is, not where its declaration (return type) starts. I guess this is as far as we can get for now. Code is available at https://github.com/ffissore/ctags if you want to tinker with it |
New preprocessor tracked at #2636. Builds for testing it are available |
This code is not properly transformed from .ino to .cpp; the line containing "0" is erroneously emitted right after the #include "Arduino.h" statement resulting in a diagnostic such as:
buggy.ino:5: error: expected unqualified-id before numeric constant
Rewriting the macro "abc" so it fits on one line avoids the problem. Note also that the line number referenced in the error message is not the line number of the macro definition or the expansion, making it difficult to find what is wrong in a large program.
I saw this using1.5.6-r2 BETA, but have not tested it on previous versions.
Peter Olson
The text was updated successfully, but these errors were encountered: