-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Possible bug in Function declaration #5103
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
Comments
The issue you are encountering should have been mitigated by arduino/arduino-builder@81eadf3 , which was merged in the nightly some days ago. Would you mind giving it a try? https://www.arduino.cc/en/Main/Software#hourly |
Thanks for your quick reply. |
You don't need to replace anything, simply unzip the package in a different location and launch the IDE from there 😄 |
Thanks |
Tried with Hourly 2016/07/05 9:33 Same result. Not declared.... |
@facchinm, I don't think that commit will solve this issue. The problem is that the prototype generator does not understand default arguments, so it refrains from generating a prototype for such a function. This is probably a wontfix, since properly parsing default arguments is quite tricky to do right. However, it does result in unexpected behaviour for users, where adding a default argument results in a un-understandable error for a function that worked fine before. I've previously wondered if we shouldn't stop generating prototypes on the longer term, but for a novice user with a simple program, the gains are significant. I wonder if it would be good to:
|
Hi @matthijskooijman , @Gorkde , sorry for the useless download, as Matthijs said you need to declare your function before its usage, such as
Being a known limitation I'm closing the issue and I'm opening an issue on arduino-builder repo to talk about the warning message |
@facchinm, will you create an issue at arduino-builder to track the need for the warning and extra documentation? |
Yep, here arduino/arduino-cli#1944 😉 |
Please see my last post here:
http://forum.arduino.cc/index.php?topic=411069.0
When declaring a function after loop() it works but in this case (providing an init value in my script) it doesn't (not declared in this scope).
The text was updated successfully, but these errors were encountered: