capstone-engine / capstone

Capstone disassembly/disassembler framework for ARM, ARM64 (ARMv8), Alpha, BPF, Ethereum VM, HPPA, LoongArch, M68K, M680X, Mips, MOS65XX, PPC, RISC-V(rv32G/rv64G), SH, Sparc, SystemZ, TMS320C64X, TriCore, Webassembly, XCore and X86.
http://www.capstone-engine.org
7.63k stars 1.56k forks source link

Towards `-Wall,-Wpedantic,-Werror` #2113

Open Rot127 opened 1 year ago

Rot127 commented 1 year ago

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.

Issues

https://github.com/capstone-engine/capstone/issues/2139

XVilka commented 1 year ago

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

peace-maker commented 1 year ago

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.

Rot127 commented 1 year ago

Agree. There are some warnings disabled though in code with pragma. Need to remove those as well at some point.

Rot127 commented 1 year ago

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.

XVilka commented 1 year ago

@imbillow could you please check the Tricore warnings when you have time?