Turn on more aggressive compile flags

This commit is contained in:
Alex 2020-07-21 15:01:06 +02:00
parent 1f136a8d54
commit 5dde15f3b6
Signed by: caskd
GPG Key ID: F92BA85F61F4C173
1 changed files with 3 additions and 1 deletions

View File

@ -1,7 +1,9 @@
cmake_minimum_required(VERSION 3.16)
project(microirc LANGUAGES C)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic")
# NOTE: Do these seem too annoying? Try writing good code then.
# Code that triggers these warnings will not be accepted unless it has a good reason to trigger them.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic -Werror -Wformat-overflow=2 -Wformat-security -Winit-self -Wstrict-overflow=2 -Wstringop-overflow=2 -Walloc-zero -Wduplicated-branches -Wduplicated-cond -Wtrampolines -Wfloat-equal -Wshadow -Wunsafe-loop-optimizations -Wparentheses -fanalyzer -fstack-protector")
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
endif()