You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gives me the following output (full path of source file replaced with ...):
# 1".../sketch_july2a.ino"
# 1".../sketch_july2a.ino"
# 2".../sketch_july2a.ino"voidsetup();
# 7".../sketch_july2a.ino"voidloop();
# 2".../sketch_july2a.ino"voidsetup() {
// put your setup code here, to run once:
}
voidloop() {
// put your main code here, to run repeatedly:
}
Expected behavior
The generated C++ code is missing #include <Arduino.h>, and the source file and line number instructions should start with #line.
This is the result of compiling the sketch with the Arduino app, which I would also expect as output of the arduino-cli command above:
#include<Arduino.h>
#line 1 ".../sketch_july2a.ino"
#line 1 ".../sketch_july2a.ino"
#line 2 ".../sketch_july2a.ino"
voidsetup();
#line 7 ".../sketch_july2a.ino"
voidloop();
#line 2 ".../sketch_july2a.ino"
voidsetup() {
// put your setup code here, to run once:
}
voidloop() {
// put your main code here, to run repeatedly:
}
This is what I get by running the arduino-cli compile command without --preprocess and looking for the C++ code in the temp folder:
#include<Arduino.h>
#line 1 ".../sketch_july2a.ino"
voidsetup() {
// put your setup code here, to run once:
}
voidloop() {
// put your main code here, to run repeatedly:
}
It's better than with --preprocess because the #include and #line directives are correct, but it's still different from the original output: it's missing the forward declaration of local procedures.
In any case, I would expect the C++ code to be the same with and without the --preprocess flag.
Bug Report
Current behavior
I created a new sketch
sketch_july2a
with the default content (empty setup and loop functions).The command
gives me the following output (full path of source file replaced with
...
):Expected behavior
The generated C++ code is missing
#include <Arduino.h>
, and the source file and line number instructions should start with#line
.This is the result of compiling the sketch with the Arduino app, which I would also expect as output of the arduino-cli command above:
Environment
massi/preprocess
Fix compile error when --preprocess or --show-properties were passed #331)Additional context
I'd like to get the C++ code that is generated as an intermediate step when compiling a sketch.
The text was updated successfully, but these errors were encountered: