CMakeLists: increase strict aliasing level to 3 The strict aliasing rules disallow dereferencing the pointer to a variable of a certain type as another type, which is frequently used e.g. when casting structs to their base type. We currently have the warning level for strict aliasing rules set to `2`, which is described by gcc(1) as being "Aggressive, quick, not too precise." And in fact, we experience quite a lot of warnings when doing a release build due to that. GCC provides multiple levels, where higher levels are more accurate, but also slower due to the additional analysis required. Still, we want to have warning level 3 instead of 2 to avoid the current warnings we have in the Travis CI release builds. As this is the default warning level when no level is passed to `-Wstrict-aliasing`, we can just remove the level and use that default.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 53f10ba..2e98bbc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -218,7 +218,7 @@ ELSE ()
ENABLE_WARNINGS(documentation)
DISABLE_WARNINGS(missing-field-initializers)
- ENABLE_WARNINGS(strict-aliasing=2)
+ ENABLE_WARNINGS(strict-aliasing)
ENABLE_WARNINGS(strict-prototypes)
ENABLE_WARNINGS(declaration-after-statement)
DISABLE_WARNINGS(unused-const-variable)