-
-
Notifications
You must be signed in to change notification settings - Fork 13
#line directive is placed at end of code line #7
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
Labels
type: imperfection
Perceived defect in any part of project
Comments
smaller test code to reproduce: int a; int b=forwardDeclared();
void setup() {}
void loop() {}
int forwardDeclared() { return 0; } |
cmaglie
added a commit
that referenced
this issue
Dec 22, 2017
The insertion point of prototypes may be detected to be in the middle of a line for example in the following sketch: int a; int b=forwardDeclared(); void setup() {} void loop() {} int forwardDeclared() { return 0; } the insertion point is determined to be between `int a;` and `int b=..` since the latter declaration use a forward-declared function to initialize variable. Before this patch this resulted in a stray `#line` directive inserted in the middle of a line: int a; #line 1 ...... <- added prototype line int forwardDeclared(); <- added prototype #line 2..... <- other prototypes.... ...... This patch avoids the situation above by inserting a newline just before the first `#line` directive if the insertion point happens to be in the middle of a line. Fix #7
cmaglie
added a commit
that referenced
this issue
Dec 26, 2017
The insertion point of prototypes may be detected to be in the middle of a line for example in the following sketch: int a; int b=forwardDeclared(); void setup() {} void loop() {} int forwardDeclared() { return 0; } the insertion point is determined to be between `int a;` and `int b=..` since the latter declaration use a forward-declared function to initialize variable. Before this patch this resulted in a stray `#line` directive inserted in the middle of a line: int a; #line 1 ...... <- added prototype line int forwardDeclared(); <- added prototype #line 2..... <- other prototypes.... ...... This patch avoids the situation above by inserting a newline just before the first `#line` directive if the insertion point happens to be in the middle of a line. Fix #7
cmaglie
added a commit
that referenced
this issue
Dec 26, 2017
The insertion point of prototypes may be detected to be in the middle of a line for example in the following sketch: int a; int b=forwardDeclared(); void setup() {} void loop() {} int forwardDeclared() { return 0; } the insertion point is determined to be between `int a;` and `int b=..` since the latter declaration use a forward-declared function to initialize variable. Before this patch this resulted in a stray `#line` directive inserted in the middle of a line: int a; #line 1 ...... <- added prototype line int forwardDeclared(); <- added prototype #line 2..... <- other prototypes.... ...... This patch avoids the situation above by inserting a newline just before the first `#line` directive if the insertion point happens to be in the middle of a line. Fix #7
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using Arduino IDE Beta build 31 with Windows 7 64 bit
Error output:
arduino-preprocessor -debug output:
https://gist.github.com/per1234/be01dbe7f6e3aa08b5775298b0c7c67c/raw/9002d3f23689badcaeddfc7de0507d1b332e66c6/arduino-preprocessor_debug_output.txt
The problem occurs at line 10184 of the output:
Where the
#line
directive was incorrectly added at the end of the code line.The issue does not occur with Arduino IDE 1.8.5 or Arduino IDE 1.8.6 Hourly Build 2017/11/13 11:33.
Originally reported by @Jomelo at http://forum.arduino.cc/index.php?topic=518385.
The text was updated successfully, but these errors were encountered: