-
-
Notifications
You must be signed in to change notification settings - Fork 114
Generated prototypes are added after global variable declarations #85
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 prototypes are generated just before the first function definition. I believe the idea is that this helps to put the prototypes after any type definitions, but in your example it also puts them after the first reference, breaking them. For now, the fix is to add a prototype manually. To really properly fix this, arduino-builder should actually parse the source and construct a dependency tree and use that to figure out where to put each prototype, but the current ctags-based approach doesn't allow that. I believe @cmaglie was looking into using clang instead of ctags, but even then the dependency generation and resolution is still a non-trivial problem... |
Understood, thanks. I wasn't sure if this was intentional or unavoidable but thought it was worth at least to document the change from 1.6.5. I have already suggested manually adding the prototype as a workaround to the reporting user |
Had to flip whole structure upside down because this piece of ****: arduino/arduino-builder#68 arduino/arduino-builder#80 arduino/arduino-builder#85 and countless other issue tickets, arduino builder preprocessor fails to do prototype and can't reorder functions so everything must be just in the right order (and also breaks many libraries and other third party boards). Code may not compile properly as long as arduino developpers can't get their **** together. Wifi part won't work until underlying issue in arduino-builder gets fixed or old version of arduino ide is used or something is gludged to overcome these issues.
Will be solved by merging #191 |
Using Arduino IDE 1.6.8 2015/12/28 12:34 with Windows 7 64 bit
Generated prototypes are added after global variable declarations which causes error when the global variable initialization calls a function.
Compiler error:
'one' was not declared in this scope
Generated code:
This compiles fine in Arduino IDE 1.6.5r5 and works in 1.6.6 and up if the function prototype is manually added.
Originally reported at http://forum.arduino.cc/index.php?topic=366573.msg2540168#msg2540168
The text was updated successfully, but these errors were encountered: