Skip to content

Enable compiler warnings when compiling CMake with Clang

I noticed that I wasn't getting any compiler warnings when testing my merge requests locally. Turns out this happens because I am compiling using Clang rather than GCC, so no warning flags are added to the build. d06a9bdf enabled warnings by default for GCC > 4.2, but Clang supports them too. This has been the case since at least Clang 3.0 (I couldn't test any older versions on godbolt.org). For AppleClang, we can also assume that the warning flags are supported. According to Wikipedia Clang became the default compiler starting with Xcode 4.2, and the table on https://trac.macports.org/wiki/XcodeVersionInfo, states that XCode 4.2 Clang was based on upstream Clang 3.0, which supports all the warning flags.

Edited by Brad King

Merge request reports