-
-
Notifications
You must be signed in to change notification settings - Fork 394
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
Add option to flag libraries as system libraries with -isystem to disable warnings #950
Comments
@cjoach @per1234 @cmaglie this is more of your realm, what's your take? |
I'm assuming that when an include path is specified with Most things on the compiler commandline are decided by I'd rather see less hardcoding in arduino-cli than more of it. Also, there might be other effects of using Also, implementing this would not actually prevent warnings in libraries entirely: When compiling .cpp files from the library itself, warnings will still be shown. If that library uses double-quote includes (e.g. This request relates to arduino/Arduino#684 and arduino/arduino-ide#1630 which are about enabling warnings by default, but also suggest a related change to enable/disable warnings for the sketch, core and libraries separately (which is essentially the same motivation driving this request, I think). Reading this request, I do realize that the previously suggested approach to this (e.g. compile library files with different warning options than sketch files) is actually still flawed: Warnings in library header files included by sketch files would still be shown. Using As a local workaround, @cjoach could try the |
Thank you @matthijskooijman for the exhaustive and informative answer :) |
I had problems with multiple pragma GCC diagnostic. I was not able to disable flags for the cpp files as @matthijskooijman mentioned. I have control only on the .h files. This indeed makes my problem more complicated. My request boils down to having a way to activate warnings for MY code only since I have essentially no control over others libraries and especially not the core libs. Simply not adding the warning flags to any file that is not part of the sketch and passing any include outside of the sketch as -isystem would resolve this problem (for me at least). I understand that this issue needs to be adressed properly for all cases but I think having a warning_flags for sketch, libs and core would be a sensible choice and has the potential to not change the default behavior. And I could disable warnings in .h files using the GCC diagnostic pragma until something better is implemented. |
I would like to disable all warnings in the libraries I'm using. Is it possible to add an option to flag libraries with
-isystem
instead of-I
?The text was updated successfully, but these errors were encountered: