Error message line numbers incorrect when compiling multiple .ino files #1479
Labels
Component: IDE
The Arduino IDE
Component: Preprocessor
The Arduino sketch preprocessor converts .ino files into C++ code before compilation
Milestone
IDE 1.0.4.
Test case:
main sketch:
Open new tab in IDE, create tab named: partb.ino
Put this in partb.ino:
Compile (eg. with Uno as target).
Error is reported at line 14:
However error is actually at line 5.
Generated combined (concatenated) file in the temporary directory is:
Note that the #line 11 directive is wrong. It is out by the number of lines in the main sketch. It is not line 11, it is line 3.
The #line directive appears to be out by 9 lines. This appears to be the number of lines in the main sketch, plus one for the #include "Arduino.h" line. (Plus one extra one, depending on which line the error is really on).
This is a simplified version of a much larger sketch that exhibited this problem. In that sketch the line number was way out, making spotting the error very hard.
The text was updated successfully, but these errors were encountered: