Skip to content

Fix prototypes line insertion logic #221

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

Merged

Conversation

facchinm
Copy link
Member

Squashed and supersedes #200, #191 and #207 .
All the code has been rebased on master

Fixes arduino#206

The sample code from the issue provided a smart way to cheat the dumb FP parser.
In fact, the & is referred to the return type (correct) but the comparator doesn't know about semantics and simply prepends the ampersand before searching for the match.
So the code matches itself, which makes absolutely no sense.
Avoiding this occurrence fixes the issue, however the entire code for prototype line insertion should be refactored in a saner way (see arduino#180 and arduino#191 for another problem)
the tag will be searched only if its signature is void and it's not being skipped for other reasons
Previously, function line numbers are extracted from any tag (in any file) so exctracted line is nonsense if the main sketch is empty/has lots of lines and lots of comments/etc

Fixes arduino#199
@ArduinoBot
Copy link
Contributor

✅ Build completed.

⬇️ Build URL: http://downloads.arduino.cc/PR/arduino-builder/arduino-builder-221.zip

ℹ️ To test this build:

  1. Replace arduino-builder binary (you can find it where you installed the IDE) with the provided one

@facchinm facchinm merged commit 4a09bad into arduino:master Jun 14, 2017
@cmaglie cmaglie deleted the FunctionPointerAsArgumentFixed_squashed branch January 11, 2018 10:11
@cmaglie cmaglie added this to the 1.4.0 milestone Sep 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants