Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Enable compiler errors for gcc/clang.
  • Loading branch information
AaronRobinsonMSFT committed Jun 1, 2022
commit 2e6f9d1cb4875cf8168b20454498f89419457c7a
7 changes: 4 additions & 3 deletions src/mono/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -502,13 +502,14 @@ if(GCC)
set(WARNINGS "-Wall -Wunused -Wmissing-declarations -Wpointer-arith -Wno-cast-qual -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value -Wno-attributes -Wno-format-zero-length -Wno-unused-function")
set(WARNINGS_C "-Wmissing-prototypes -Wstrict-prototypes -Wnested-externs")

set(WERROR "-Werror=return-type")
set(WERROR_C "-Werror=implicit-function-declaration -Werror=implicit-int-conversion")

if (CMAKE_C_COMPILER_ID MATCHES "Clang")
set(WARNINGS "${WARNINGS} -Qunused-arguments -Wno-tautological-compare -Wno-parentheses-equality -Wno-self-assign -Wno-return-stack-address -Wno-constant-logical-operand -Wno-zero-length-array -Wno-asm-operand-widths")
set(WERROR "${WERROR} -Werror=shorten-64-to-32")
endif()

set(WERROR "-Werror=return-type")
set(WERROR_C "-Werror=implicit-function-declaration")

check_c_compiler_flag("-Werror=incompatible-pointer-types" WERROR_INCOMPATIBLE_POINTER_TYPES)
if(WERROR_INCOMPATIBLE_POINTER_TYPES)
set(WERROR_C "${WERROR_C} -Werror=incompatible-pointer-types")
Expand Down