Skip to content

Commit 03c4f86

Browse files
committed
cmake: enable warnings for missing function declarations
Over time, we have accumulated quite a lot of functions with missing prototypes, missing `static` keywords or which were completely unused. It's easy to miss these mistakes, but luckily GCC and Clang both have the `-Wmissing-declarations` warning. Enabling this will cause them to emit warnings for every not-static function that doesn't have a previous declaration. This is a very sane thing to enable, and with the preceding commits all these new warnings have been fixed. So let's always enable this warning so we won't introduce new instances of them.
1 parent fd1f094 commit 03c4f86

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ SET(LIBGIT2_INCLUDES
2121
SET(LIBGIT2_SYSTEM_INCLUDES "")
2222
SET(LIBGIT2_LIBS "")
2323

24+
enable_warnings(missing-declarations)
25+
2426
# Enable tracing
2527
IF(ENABLE_TRACE)
2628
SET(GIT_TRACE 1)

0 commit comments

Comments
 (0)