Towards `-Wall,-Wpedantic,-Werror`
We had now several times that the CI in Capstone is fine with several build warnings, but external projects are not.
For v6 or at least v7 we should be able to compile CS without any build warnings.
Especially since everything is C and more strict is always better in this case.
- [x] Builds with
-Wall- [x]
-Wenum(120 warnings) - [x]
-Woverlength(4 warnings) - [x]
-Wshadow(28 warnings) - https://github.com/capstone-engine/capstone/issues/2170
- [x]
- [ ] Builds with
-Wpedantic(1926 warnings) in- [ ]
ARMDisassembler.c - [ ]
arm.h - [ ]
ARMInstPrinter.c - [ ]
bpf.h - [ ]
capstone.h - [ ]
Mapping.h - [ ]
MCInst.h - [ ]
mips.h - [ ]
ppc.h - [ ]
PPCInstPrinter.c - [ ]
PPCInstPrinter.h - [ ]
riscv.h - [ ]
sh.h - [ ]
sparc.h - [ ]
systemz.h - [ ]
tricore.h - [ ]
TriCoreInstPrinter.c - [ ]
wasm.h - [ ]
xcore.h
- [ ]
Issues
https://github.com/capstone-engine/capstone/issues/2139
Another possible step would be also adding clang-tidy into the CI, see this for example: https://gitlab.com/OpenMW/openmw/-/merge_requests/900/diffs
The same can be done for msvc to get more digital eyes on the code. "Werror" can be enabled as well using "/WX". There aren't that many problems when building with -Wall https://github.com/capstone-engine/capstone/commit/2d8dad66f834ecf6699e459ed7ef92d059db6b52 so maybe it's already possible for v6.
Agree. There are some warnings disabled though in code with pragma. Need to remove those as well at some point.
Made a build with -Wall and -Wpedantic. We are not so far from passing -Wall! And Wpedantic seems mostly a problem with our header files. Added a list above.
@imbillow could you please check the Tricore warnings when you have time?