Coder Social home page Coder Social logo

Comments (4)

AgainPsychoX avatar AgainPsychoX commented on June 3, 2024

Workaround using more extra scripting

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

Workaround using other include flag

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.

By the way

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

from arduino-pico.

AgainPsychoX avatar AgainPsychoX commented on June 3, 2024

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 -iwithprefixs, but it could work if code in platformio-build.py would be changed too (also to -iwithprefix):

for l in file_lines:
path = l.strip().replace("-iwithprefixbefore/", "").replace("/", os.sep)
# emulate -iprefix <framework path>.
path = os.path.join(FRAMEWORK_DIR, path)
# prevent non-existent paths from being added
if os.path.isdir(path):
includes.append(path)

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.

from arduino-pico.

earlephilhower avatar earlephilhower commented on June 3, 2024

Those headers are used in the core and built in the CI without warnings. Are you using a non standard compiler or set up?

from arduino-pico.

AgainPsychoX avatar AgainPsychoX commented on June 3, 2024

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.

from arduino-pico.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.