1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-06-25 16:57:12 -07:00

tweak C flags so stuff works properly

This commit is contained in:
Connor Olding 2017-11-02 15:14:08 +00:00
parent de995c7485
commit f1c3609ec1
2 changed files with 7 additions and 5 deletions

View File

@ -117,7 +117,7 @@ whoa=(
-Wlogical-op
-Wrestrict # gcc 7
-Wnull-dereference # gcc 6
-Wjump-misses-init
#-Wjump-misses-init # only for C
-Wdouble-promotion
-Wformat=2
)

View File

@ -127,10 +127,10 @@ compile() {
local dr_flags=(-Ox -Zi)
local hardened_flags=(-Ox -sdl)
else
local debug_flags=(-O1 -g -D_DEBUG);
local release_flags=(-Ofast -march=native -g0 -fomit-frame-pointer -s -DNDEBUG)
local dr_flags=(-Ofast -march=native -g -fomit-frame-pointer -DNDEBUG)
local hardened_flags=(-O3 -march=native -g0 -s
local debug_flags=(-O1 -march=native -g -D_DEBUG);
local release_flags=(-Ofast -march=native -mtune=native -g0 -fomit-frame-pointer -s -DNDEBUG)
local dr_flags=(-Ofast -march=native -mtune=native -g -fomit-frame-pointer -DNDEBUG)
local hardened_flags=(-O3 -march=native -mtune=native -g0 -s
-DNDEBUG -D_FORTIFY_SOURCE=2
-Wformat -Wformat-security -Werror=format-security)
@ -220,6 +220,8 @@ compile() {
if [ $sepples -eq 0 ] && [[ $flag == -Wextra ]] then
# enable some warnings just for C. too annoying in C++.
warnings+=(-Wshadow -Winline)
# these ones only work with C.
warnings+=(-Wjump-misses-init)
fi
if [ $CC = cl ] && [ $flag = -Wall ]; then