mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 08:18:17 +00:00
Merge pull request #3414 from Pyrohh/cmake-check-wvla
build: Check for -Wvla before use
This commit is contained in:
@@ -142,7 +142,7 @@ if(MSVC)
|
|||||||
add_definitions(/W3 -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
|
add_definitions(/W3 -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
|
||||||
else()
|
else()
|
||||||
add_definitions(-Wall -Wextra -pedantic -Wno-unused-parameter
|
add_definitions(-Wall -Wextra -pedantic -Wno-unused-parameter
|
||||||
-Wstrict-prototypes -Wvla -std=gnu99)
|
-Wstrict-prototypes -std=gnu99)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MINGW)
|
if(MINGW)
|
||||||
@@ -150,9 +150,14 @@ if(MINGW)
|
|||||||
add_definitions(-D__USE_MINGW_ANSI_STDIO)
|
add_definitions(-D__USE_MINGW_ANSI_STDIO)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# OpenBSD's GCC (4.2.1) doesn't have -Wvla
|
||||||
|
check_c_compiler_flag(-Wvla HAS_WVLA_FLAG)
|
||||||
|
if(HAS_WVLA_FLAG)
|
||||||
|
add_definitions(-Wvla)
|
||||||
|
endif()
|
||||||
|
|
||||||
check_c_compiler_flag(-fstack-protector-strong HAS_FSTACK_PROTECTOR_STRONG_FLAG)
|
check_c_compiler_flag(-fstack-protector-strong HAS_FSTACK_PROTECTOR_STRONG_FLAG)
|
||||||
check_c_compiler_flag(-fstack-protector HAS_FSTACK_PROTECTOR_FLAG)
|
check_c_compiler_flag(-fstack-protector HAS_FSTACK_PROTECTOR_FLAG)
|
||||||
|
|
||||||
if(HAS_FSTACK_PROTECTOR_STRONG_FLAG)
|
if(HAS_FSTACK_PROTECTOR_STRONG_FLAG)
|
||||||
add_definitions(-fstack-protector-strong)
|
add_definitions(-fstack-protector-strong)
|
||||||
elseif(HAS_FSTACK_PROTECTOR_FLAG)
|
elseif(HAS_FSTACK_PROTECTOR_FLAG)
|
||||||
|
Reference in New Issue
Block a user