Closed as not planned
Description
Describe the problem
Sketch compilation fails if the sketch contains invisible characters. I do not know if it's a builder, preprocessor, or pure C++ issue.
To reproduce
void setup() {
char s = 'x' ;
}
void loop() {}
Note that after the 'x'
there is an invisible character.
Compilation:
a.kitta@Akoss-MacBook-Pro sketch_jul18b % ~/dev/git/arduino-ide/arduino-ide-extension/build/arduino-cli version
arduino-cli Version: 0.25.0-rc1 Commit: 63b53c0f Date: 2022-07-11T16:09:52Z
a.kitta@Akoss-MacBook-Pro sketch_jul18b % cat ~/Documents/Arduino/sketch_jul18b/sketch_jul18b.ino
void setup() {
char s = 'x' ;
}
void loop() {}
a.kitta@Akoss-MacBook-Pro sketch_jul18b % ~/dev/git/arduino-ide/arduino-ide-extension/build/arduino-cli compile -b arduino:samd:mkr1000 ~/Documents/Arduino/sketch_jul18b
/Users/a.kitta/Documents/Arduino/sketch_jul18b/sketch_jul18b.ino:2:15: error: stray '\302' in program
char s = 'x'��;
^
/Users/a.kitta/Documents/Arduino/sketch_jul18b/sketch_jul18b.ino:2:16: error: stray '\240' in program
char s = 'x'��;
^
Used platform Version Path
arduino:samd 1.8.13 /Users/a.kitta/Library/Arduino15/packages/arduino/hardware/samd/1.8.13
Error during build: exit status 1
Expected behavior
If it's possible to compile a cpp
file that contains the <0xa0>
invisible character, I would expect to work with the CLI too.
Arduino CLI version
arduino-cli Version: 0.25.0-rc1 Commit: 63b53c0 Date: 2022-07-11T16:09:52Z
Operating system
macOS
Operating system version
12.3.1
Additional context
Based initially on arduino/arduino-ide#1210.
Possibly related (based on the compiler error message): #1785
Issue checklist
- I searched for previous reports in the issue tracker
- I verified the problem still occurs when using the nightly build
- My report contains all necessary details