Skip to content

#line directive is placed at end of code line #7

Closed
@per1234

Description

@per1234
Contributor

Using Arduino IDE Beta build 31 with Windows 7 64 bit

  1. Download https://github.com/Jomelo/LCDMenuLib2/archive/v1.0.1.zip
  2. Sketch > Include Library > Add .ZIP Library > Select the downloaded file > Open
  3. Tools > Board > Arduino/Genuino Uno
  4. File > Examples > LCDMenuLib2 > 00_beginners > LCDML_000_serialMonitor
  5. Sketch > Verify/Compile

Error output:

LCDML_000_serialMonitor:80:88: error: stray '#' in program

     Serial.begin(9600);                // start serial    

                                                                                        ^

LCDML_000_serialMonitor:80:89: error: 'line' does not name a type

     Serial.begin(9600);                // start serial    

                                                                                         ^

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:

  const char g_LCDML_DISP_lang_0_var[] __attribute__((__progmem__)) = {"Information"}; #line 47 "E:\\Stuff\\misc\\electronics\\arduino\\libraries\\LCDMenuLib2-1.0.1\\examples\\00_beginners\\LCDML_000_serialMonitor\\LCDML_000_serialMonitor.ino"

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.

Activity

cmaglie

cmaglie commented on Dec 22, 2017

@cmaglie
Member

smaller test code to reproduce:

int a; int b=forwardDeclared();

void setup() {}
void loop() {}
int forwardDeclared() { return 0; }
added a commit that references this issue on Dec 22, 2017
0310a5a
added 2 commits that reference this issue on Dec 26, 2017
382849d
4d6845a
added 2 commits that reference this issue on Dec 26, 2017
867362e
fb0dfb5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @cmaglie@per1234@rsora

        Issue actions

          #line directive is placed at end of code line · Issue #7 · arduino/arduino-preprocessor