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
This is Issue 1112 moved from a Google Code project.
Added by 2012-11-14T09:18:07.000Z by [email protected].
Please review that bug for more context and additional comments, but update this bug.
Closed (WontFix).
Original labels: Type-Defect, Priority-Medium
Original description
The Arduino development environment makes a series of modifications to the code provided by the user, presumably as a user-friendly gesture towards those who can't code proper C++.
The problem is that people who actually know C++ and write sketches (?) on accordance are having a lot of pain with those "user-friendly" source code transformations. Basically, the Arduino IDE turns perfectly valid C++ programs into incorrect ones.
A glaring example is the automatic generation of function prototypes, which are fundamentally broken. Even the recent patch mentioned in
falls short on the presence of functions with default arguments, and I suspect that it fails too when the function signature spans over several lines.
C++ syntax is really complex and automatic generation of prototypes won't work unless you implement a good chunk of a C++ parser, which is unlikely to happen if reasonable at all.
So I suggest allowing some sort of flag in the source code of those sketches for indicating "I'm a C++ programmer. Honest!" and stopping the Arduino IDE from messing with the code. Switching off prototype generation to begin with, although not prepending the code with the standard Arduino headers would be good too for avoiding problems with line numbers of compiler reports, see
I realize that not adding those headers could pose maintenance problems for the user when the Arduino developers decide to use a difference preamble, but we are talking about real C++ developers and they can quickly figure out what the problem is on that case.
Something like
pragma arduino-literal-C++-code
should be fine. The IDE would inspect the sketch for the presence of that text and switch off the related features.
The text was updated successfully, but these errors were encountered:
This is Issue 1112 moved from a Google Code project.
Added by 2012-11-14T09:18:07.000Z by [email protected].
Please review that bug for more context and additional comments, but update this bug.
Closed (WontFix).
Original labels: Type-Defect, Priority-Medium
Original description
The Arduino development environment makes a series of modifications to the code provided by the user, presumably as a user-friendly gesture towards those who can't code proper C++.
The problem is that people who actually know C++ and write sketches (?) on accordance are having a lot of pain with those "user-friendly" source code transformations. Basically, the Arduino IDE turns perfectly valid C++ programs into incorrect ones.
A glaring example is the automatic generation of function prototypes, which are fundamentally broken. Even the recent patch mentioned in
http://code.google.com/p/arduino/issues/detail?id=973
falls short on the presence of functions with default arguments, and I suspect that it fails too when the function signature spans over several lines.
C++ syntax is really complex and automatic generation of prototypes won't work unless you implement a good chunk of a C++ parser, which is unlikely to happen if reasonable at all.
So I suggest allowing some sort of flag in the source code of those sketches for indicating "I'm a C++ programmer. Honest!" and stopping the Arduino IDE from messing with the code. Switching off prototype generation to begin with, although not prepending the code with the standard Arduino headers would be good too for avoiding problems with line numbers of compiler reports, see
http://code.google.com/p/arduino/issues/detail?id=455
I realize that not adding those headers could pose maintenance problems for the user when the Arduino developers decide to use a difference preamble, but we are talking about real C++ developers and they can quickly figure out what the problem is on that case.
Something like
pragma arduino-literal-C++-code
should be fine. The IDE would inspect the sketch for the presence of that text and switch off the related features.
The text was updated successfully, but these errors were encountered: