Closed AgainPsychoX closed 7 months ago
I updated my extra script as workaround, adding all the file parsing, then prefixes unrolling and changing the framework includes to use -isystem
. Gist: https://gist.github.com/AgainPsychoX/45d55d4d7004cb6f20f7920807f72981 .
I guess it's not perfect, as now the whole process has to create temporary files because of how long the shell command is with all those arguments. Here is pio run --verbose 2>&1 > verbose.log
after modifying one of my project files: Gist: https://gist.github.com/AgainPsychoX/0c4b897d110dfdcdb7ce9c0971be4d76#file-modified_only_one_of_my_files-log
Meanwhile I learnt there is -iwithprefixbefore
(acts like -I
) and -iwithprefix
(acts like -idirafter
). The priority of includes is different, but it seems working if I change them in the platform_inc.txt
file - which makes my script modification I just wrote useless, welp. https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html
Do you think could it be updated in the repo? I don't want to create pull request, since I am not sure if it changes/breaks anything due to the include order changes; would require some intuition to judge it and testing to make sure, I imagine.
Using those workarounds, nor any of my attempts so far, I haven't managed to get rid of all warnings. While I see them no more while modifying my files, there are still some after cleaning the environment - due to recompilation of some framework provided .cpp
files - but in this case its rare issue. Gist of example log: https://gist.github.com/AgainPsychoX/0c4b897d110dfdcdb7ce9c0971be4d76#file-modified_only_one_of_my_files-log
Update: I just found out that using second workaround doesn't work for me: VS Code c_cpp_properties.json
is missing stuff if platform_inc.txt
contains just -iwithprefix
s, but it could work if code in platformio-build.py
would be changed too (also to -iwithprefix
):
For now I will be using my extra script, but I hope you consider if -iwithprefix
could be used in the official version. I could make pull request if you want, but again: it would require knowledge/testing if changed include order affects anything.
Those headers are used in the core and built in the CI without warnings. Are you using a non standard compiler or set up?
I don't think so.
Versions are in the logs:
PACKAGES:
- framework-arduinopico @ 1.30700.0+sha.88ccf0c (git+https://github.com/earlephilhower/arduino-pico.git#88ccf0c256dc717ff932adc9e2d84485214bf2e5)
- tool-rp2040tools @ 1.0.2
- toolchain-rp2040-earlephilhower @ 5.120300.240125 (12.3.0, https://github.com/earlephilhower/pico-quick-toolchain/releases/download/2.2.0/x86_64-w64-mingw32.arm-none-eabi-d04e724.240125.zip)
The example warning I included in the first post seems to come from -Wpedantic
which got applied to code in framework/pico sdk headers (i.e. pico/assert.h
) included by my code (my cpp
file).
BTW, sorry for late response.
While compiling my project there are a lot of warnings coming vendor code I can't directly change, so I wan to silence it to focus on my own project files.
My setup
I use PlatformIO include Visual Studio Code on Windows.
I use combination of
build_unflags
/build_src_flags
to apply warnings only to my sourced compilation units, and then extra script to change paths inCPPPATH
to use-isystem
to ignore the warnings.My
platformio.ini
:I use extra script
scripts/convert_sysincludes.py
to convert some includes to be included as-isystem
:Sadly, it's not enough.
Example warnings when compiling:
Using
pio run --verbose
I can inspect final compiler arguments:And I can see
-iprefixC:\Users\PsychoX\.platformio\packages\framework-arduinopico @C:\Users\PsychoX\.platformio\packages\framework-arduinopico\lib\platform_inc.txt
which the extra script I use can do nothing about (or rather would be quite hard) to make it as system (so warnings ignored) include.While researching issue I found #615: https://github.com/earlephilhower/arduino-pico/blob/2a256f9c25021deee92a5eece6137dbe1438e0ec/tools/platformio-build.py#L185-L192
-isystem
anyways?