Open galou opened 8 years ago
I may have found a bug probably during preprocessing of an ino file by arduino-cmake.
Excerpt (I cannot show the whole file):
void loop() { if (true) { } else if (true) { } }
Produces an error:
error: expected unqualified-id before ‘else’ else if (true) ;
The generated cpp file is (excerpt)
void setup() ; void setup() ; void loop() ; void loop() ; else if (true) ; else if (true) ;
If I change the else if with if, the file compiles.
else if
if
However, I could not reproduce with the following with a simple sketch file which works
void setup() {} void loop() { if (true) { } else if (true) { } }
There is a syntax error in the inner body of your if block. Make sure that you end with the same number of braces that you started with. Please be sure to brush up on C++ while you are on it.
I may have found a bug probably during preprocessing of an ino file by arduino-cmake.
Excerpt (I cannot show the whole file):
Produces an error:
The generated cpp file is (excerpt)
If I change the
else if
withif
, the file compiles.However, I could not reproduce with the following with a simple sketch file which works