From f29019f9cc699dfc8f0f03cb3f8c39138f300caf Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 23 Feb 2021 13:44:41 +0100 Subject: [PATCH] Build tests with -Wdocumentation when using Clang Signed-off-by: Gilles Peskine --- tests/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index cefc5c929..e2bc42018 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -67,6 +67,10 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function") endif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG) +if(CMAKE_COMPILER_IS_CLANG) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wdocumentation -Wno-documentation-deprecated-sync -Wunreachable-code") +endif(CMAKE_COMPILER_IS_CLANG) + if(MSVC) # If a warning level has been defined, suppress all warnings for test code set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W0")