build: use feature detection when adding compile flags Rather than trying to detect (potentially very old) GCC versions, just test whether the flag works with the compiler, and add it to CLFAGS if so. -Werror is used to convert unknown flag warnings into errors, and prevent their addition to CLFAGS.