Commit 4a6ef5a4a6cabfaa7147aab28130da49e5b177ea

Edward Thomson 2021-11-11T17:04:24

cmake: move missing-declarations warning to top-level We should enforce declarations throughout the code-base, including examples, fuzzers and tests, not just in the `src` tree.

diff --git a/cmake/DefaultCFlags.cmake b/cmake/DefaultCFlags.cmake
index d122f6c..fa59e1d 100644
--- a/cmake/DefaultCFlags.cmake
+++ b/cmake/DefaultCFlags.cmake
@@ -125,6 +125,7 @@ else()
 	enable_warnings(documentation)
 	disable_warnings(documentation-deprecated-sync)
 	disable_warnings(missing-field-initializers)
+	enable_warnings(missing-declarations)
 	enable_warnings(strict-aliasing)
 	enable_warnings(strict-prototypes)
 	enable_warnings(declaration-after-statement)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ae02ef9..6a128cf 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -41,8 +41,6 @@ set(LIBGIT2_INCLUDES
 set(LIBGIT2_SYSTEM_INCLUDES "")
 set(LIBGIT2_LIBS "")
 
-enable_warnings(missing-declarations)
-
 if(HAVE_FUTIMENS)
 	set(GIT_USE_FUTIMENS 1)
 endif ()