mirror of
https://github.com/raysan5/raylib.git
synced 2026-01-11 05:58:44 +01:00
GCC/Clang: Treat void pointer arithmetic as error
As an extension, GNU C treats sizeof(void) as 1. MSVC doesn't. Make it an error on GCC/Clang to avoid accidental MSVC breakage.
This commit is contained in:
@ -11,6 +11,11 @@ if(CMAKE_VERSION VERSION_LESS "3.1")
|
||||
else()
|
||||
set (CMAKE_C_STANDARD 99)
|
||||
endif()
|
||||
include(CheckCCompilerFlag)
|
||||
CHECK_C_COMPILER_FLAG("-Werror=pointer-arith" COMPILER_HAS_POINTER_ARITH_TOGGLE)
|
||||
if(COMPILER_HAS_POINTER_ARITH_TOGGLE)
|
||||
set(CMAKE_C_FLAGS "-Werror=pointer-arith ${CMAKE_C_FLAGS}")
|
||||
endif()
|
||||
|
||||
add_subdirectory(src release)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user