Enable "missing prototypes" warning for gcc, clang

Missing prototypes for exported functions cause a really huge issue on
Windows.  Enabling the "missing prototypes" warning makes it much easier
to catch this problem.  Naturally, any warnings caused by this have been
fixed.

Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
Erik Boasson 2019-06-05 11:19:43 +02:00 committed by eboasson
parent a4d8aba4f9
commit 32b683bf37
26 changed files with 92 additions and 304 deletions

View file

@ -87,12 +87,12 @@ endif()
# Set reasonably strict warning options for clang, gcc, msvc
# Enable coloured ouput if Ninja is used for building
if(${CMAKE_C_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_C_COMPILER_ID} STREQUAL "AppleClang")
add_definitions(-Wall -Wextra -Wconversion -Wunused)
add_definitions(-Wall -Wextra -Wconversion -Wunused -Wmissing-prototypes)
if(${CMAKE_GENERATOR} STREQUAL "Ninja")
add_definitions(-Xclang -fcolor-diagnostics)
endif()
elseif(${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
add_definitions(-Wall -Wextra -Wconversion)
add_definitions(-Wall -Wextra -Wconversion -Wmissing-prototypes)
if(${CMAKE_GENERATOR} STREQUAL "Ninja")
add_definitions(-fdiagnostics-color=always)
endif()
@ -131,6 +131,7 @@ if(${CMAKE_GENERATOR} STREQUAL "Xcode")
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNUSED_VALUE YES)
set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNUSED_VARIABLE YES)
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_DOCUMENTATION_COMMENTS YES)
set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_MISSING_PROTOTYPES YES)
endif()
# Make it easy to enable one of Clang's/gcc's analyzers, and default to using