Generated prototype incorrectly prefixed with extern "C"
when comment contains //
#1591
Open
3 tasks done
Labels
topic: build-process
Related to the sketch build process
topic: code
Related to content of the project itself
type: imperfection
Perceived defect in any part of project
Describe the problem
A stray curly-brace in
//
comments or#if (false)
sections causes the function prototypes generated during the "sketch pre-processing" stage of the compilation operation to be incorrectly prefixed withextern "C"
For example:
To reproduce
Compile the following sketch:
Examine the
.cpp
file generated by the compilation.🐛 Generated function prototypes are prefixed with
extern "C"
Compile the following sketch:
Examine the
.cpp
file generated by the compilation.🐛 Generated function prototypes are prefixed with
extern "C"
Expected behavior
Generated function prototypes should be correct regardless of the contents of comments:
Arduino CLI version
Original report
Arduino IDE v1.8.16
Last verified with
d563755
Operating system
Windows
Operating system version
11
Additional context
I note that there are several discussions regarding curly-braces for Arduino IDE but none of these seem to cover this specific issue:
Additional reports
Related
extern "C"
when usingextern "C" { ... }
to mix C functions in an.ino
file. #1618Issue checklist
The text was updated successfully, but these errors were encountered: