Skip to content

Generated prototype for function in tab causes #line directive to have the wrong filename #99

Closed
@per1234

Description

@per1234

Using Arduino IDE 1.6.8 2016/01/19 08:42 with Windows 7 64bit

tab1.ino:

void setup() {
  bug
}
void loop() {}

tab2.ino:

void dummy() {
}

Compiler error:

C:\Users\per\AppData\Local\Temp\arduino_modified_sketch_968481\tab2.ino: In function 'void setup()':
tab2:2: error: 'bug' was not declared in this scope

The error highlight is also on the wrong tab.

C:\Users\per\AppData\Local\Temp\buildc2e11d1cafc78478b2a43bb59a48970a.tmp\sketch\tab1.ino.cpp:

#include <Arduino.h>
#line 1
#line 1 "C:\\Users\\per\\AppData\\Local\\Temp\\arduino_modified_sketch_968481\\tab1.ino"
#line 1 "C:\\Users\\per\\AppData\\Local\\Temp\\arduino_modified_sketch_968481\\tab1.ino"
void setup();
#line 4 "C:\\Users\\per\\AppData\\Local\\Temp\\arduino_modified_sketch_968481\\tab1.ino"
void loop();
#line 1 "C:\\Users\\per\\AppData\\Local\\Temp\\arduino_modified_sketch_968481\\tab2.ino"
void dummy();
#line 1
void setup() {
  bug
}
void loop() {}
#line 1 "C:\\Users\\per\\AppData\\Local\\Temp\\arduino_modified_sketch_968481\\tab2.ino"
void dummy() {
}

The last #line directive should specify the tab1.ino filename.

This also can cause the __FILE__ macro to have the wrong value.

Originally reported at: http://forum.arduino.cc/index.php?topic=372882.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions