Skip to content

Stop changing my code [imported] #1112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cmaglie opened this issue Nov 15, 2012 · 0 comments
Closed

Stop changing my code [imported] #1112

cmaglie opened this issue Nov 15, 2012 · 0 comments
Labels
Type: Wontfix Arduino has decided that it will not resolve the reported issue or implement the requested feature

Comments

@cmaglie
Copy link
Member

cmaglie commented Nov 15, 2012

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.

@cmaglie cmaglie closed this as completed Nov 15, 2012
@per1234 per1234 added the Type: Wontfix Arduino has decided that it will not resolve the reported issue or implement the requested feature label Jul 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Wontfix Arduino has decided that it will not resolve the reported issue or implement the requested feature
Projects
None yet
Development

No branches or pull requests

2 participants