Enable -Werror=incompatible-pointer-types gcc flag
Motivation
The gcc warning -wincompatible-pointer-types
probably almost always points out real problems/bugs, and so it ought to be more noisy. Where the use is intentional, the warning can be silenced by using an appropriate type cast.
See for example !4745 (closed), where this warning being an error would have detected the problem promptly. As it was, the MR languished for 9 months, and the final diagnosis required about a day's work to set up a windows VM and windows dev environment (just to see the warning).
Proposal
Use the gcc flag -Werror=incompatible-pointer-types
for building ghc RTS C code (at least in CI and in ./validate). Use the LLVM/clang equivalent for clang build flavours.
Or perhaps more aggressively we should use -Werror
and then -Wno-error=
for specific warnings.