CMakeLists: Enabled more clang warnings.
Enable `-Wextra` and `-Wunreachable-code-loop-increment`.
Disable `-Wno-unused-parameter`.
Detects the build warning / breakage fixed by https://swiftshader-review.googlesource.com/c/SwiftShader/+/43989.
Bug: none. Reducing chance of future build breakages.
Change-Id: I3001f0ded71f2f71f817581996cc727e345845a3
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43991
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e131a13..6601868 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -364,6 +364,8 @@
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
list(APPEND SWIFTSHADER_COMPILE_OPTIONS
+ "-Wextra"
+ "-Wunreachable-code-loop-increment"
"-Wunused-lambda-capture"
"-Wstring-conversion"
"-Wextra-semi"
@@ -403,6 +405,7 @@
"-Wno-comment" # multi-line comment
"-Wno-undefined-var-template" # instantiation of variable 'X' required here, but no definition is available
"-Wno-extra-semi" # extra ';' after member function definition
+ "-Wno-unused-parameter" # unused parameter 'X'
# Silence errors caused by unknown warnings when building with older
# versions of Clang. This demands checking that warnings added above