Open Zorvalt opened 2 years ago
Please open a pull request, I found this same problem and it took me a while to figure it out. For future reference, from the openocd-spi
directory run:
git remote add zorvalt https://github.com/Zorvalt/openocd-spi/
git pull zorvalt fix-multiple-gcc-10-errors
make
Thanks for the help!
Thanks for sharing :)
Thanks @Zorvalt worked perfectly.
These compilation errors are also present with GCC 12.2.0 and this commit fixes everything 👍
There are compilation issues when using the latest gcc version on raspbian (currently 10.2.1-1+rpi1). To fix those errors, I was able to cherry-pick different commits but I had to fix the first one by hand because I got into a chain of emerging error due to dependency on older commits (see first error below).
I pushed everything on a fork, here : https://github.com/Zorvalt/openocd-spi/tree/fix-multiple-gcc-10-errors
I'd like to know if I should create a PR or not ? Maybe rebasing this repository on openocd-org/openocd would be better as the more time passes, the more it is likely that cherry-picking will be hard...
To explain what I changed, here is the list of errors I fixed without any special order :
‘status’ may be used uninitialized in this function
I fixed those by initializing status with
(uint32_t)-1
like they did upstream : https://github.com/openocd-org/openocd/commit/be57b0ab847e8246b354ca9203024737cdec403b I did not cherry-pick the commit because it changes a lot more than needed and I do not have the time to fully review how it impacts the whole project.Commit fixing this error : https://github.com/openocd-org/openocd/commit/be57b0ab847e8246b354ca9203024737cdec403b Applying it breaks some types comparisons like
sector < bank->num_sectors
in https://github.com/openocd-org/openocd/commit/be57b0ab847e8246b354ca9203024737cdec403b#diff-5e2e3ea9c2f7e815c40a02619a32e1f45d1dd8e3254bb380740f2f9097220f4aR283 This can in turn be fixed with https://github.com/openocd-org/openocd/commit/ef14384b681af4f731f768bb866457832af6925f which breaks other parts again and I stopped my investigations there in favor of a simple two line commit.accessing
N
bytes in a region of size 8Fixed by cherry-picking https://github.com/openocd-org/openocd/commit/6db49eb8858023654084088c73d968e190aec491
'ftdi_usb_purge_buffers' is deprecated
Fixed by cherry-picking https://github.com/openocd-org/openocd/commit/5bb0f6befb3c3f06903cee93f14bdd917abf21e7
'out' may be used uninitialized
Fixed by cherry-picking https://github.com/openocd-org/openocd/commit/a2e822834df52efef5e1bbcb91a6eb1afbf102db