-
-
Notifications
You must be signed in to change notification settings - Fork 114
add #line directive to additional source files #325
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
Conversation
improvement for arduino#323
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a sane approach, so I'm in favour of merging this.
Code looks good to me. I haven't tested the code, though.
Two doubts I have:
- For what kinds of files is this #line directive now added?
.cpp
,.c
and.h
files are of course fine, but how about assembly files? Can there be any other types of files in the list of "Additional files" that do not like#line
directives? - When files to be modified are really big, then the in-memory prepending of the line directive might be ineffecient (compared to writing the line directive first and then the original contents). I can see why we need this to compare the file contents, though. Also, source files are usually not really big and since we're reading things into memory in the first place, that's already inefficient and suited for big (e.g. 10's or 100's of MB) files anyway, so I guess this is a non-issue.
To your first doubt: To your second doubt: |
+1 This would be super useful. I presume this would "automatically" be part of ardino-cli ? Which is what I am using, and what people who care about correct error messages could be likely to use? Any way to move this along? Now has conflicts? |
the bad news is they had changed the master, without incorporating my changes, so now we have conflicts... :-( the good news is that my friend already rewrote my code to the new base :-) we can try to re-apply his changes, but I highly doubt those would get merged into the main base... :-/ so our only hope is to fork the project and take control over it! ;-) |
Shame, it's a pretty trivial change, which is not very invasive and very useful . Is there a pull request for the updated version against current master? |
I believe this code was moved to the |
I am not active on arduino any more, since I am writing a game for 8-bit computer ZX Spectrum right now along with a new IO game online game however I will let my friend know that you are interested in this kind of change so he can step in and take over the hassle of communication with the arduino development team |
I am running arduino-cli V 0.10.0, which includes this line: Which looks to me like it should be doing what we want. So this actually becomes a different case altogether? ie, a bug/issue, why is it not working on my code. I will investigate. Could well be to do with arduino-cli expecting my "extra files" to have a different extension or something like that. Anyway, I think we should close this issue, it can never be merged. And "in spirit" at least, it has been included in arduino-cli. Agree? |
That line applies to the merged .ino files (e.g. the |
@matthijskooijman Yeah, I just kind of figured that out too. Arduino does do some really weird preprocessing, coming from a CPP background. We just need a single line inserted at the beginning of each "additional file" copy. So this should not be too hard. I know no Go at all, but I think even I can manage that with a bit of "copy/paste coding". Will have a "Go"... ;-) and make a pull request. Thanks |
It was a one-liner. Here is the pull request: arduino/arduino-cli#707 |
|
Closing as superseded by arduino/arduino-cli#1224. Thanks everyone for your contributions! |
improvement for #323