mirror of
https://github.com/notwa/rc
synced 2024-06-30 19:07:11 -07:00
tweak C flags so stuff works properly
This commit is contained in:
parent
de995c7485
commit
f1c3609ec1
|
@ -117,7 +117,7 @@ whoa=(
|
||||||
-Wlogical-op
|
-Wlogical-op
|
||||||
-Wrestrict # gcc 7
|
-Wrestrict # gcc 7
|
||||||
-Wnull-dereference # gcc 6
|
-Wnull-dereference # gcc 6
|
||||||
-Wjump-misses-init
|
#-Wjump-misses-init # only for C
|
||||||
-Wdouble-promotion
|
-Wdouble-promotion
|
||||||
-Wformat=2
|
-Wformat=2
|
||||||
)
|
)
|
||||||
|
|
10
sh/compile
10
sh/compile
|
@ -127,10 +127,10 @@ compile() {
|
||||||
local dr_flags=(-Ox -Zi)
|
local dr_flags=(-Ox -Zi)
|
||||||
local hardened_flags=(-Ox -sdl)
|
local hardened_flags=(-Ox -sdl)
|
||||||
else
|
else
|
||||||
local debug_flags=(-O1 -g -D_DEBUG);
|
local debug_flags=(-O1 -march=native -g -D_DEBUG);
|
||||||
local release_flags=(-Ofast -march=native -g0 -fomit-frame-pointer -s -DNDEBUG)
|
local release_flags=(-Ofast -march=native -mtune=native -g0 -fomit-frame-pointer -s -DNDEBUG)
|
||||||
local dr_flags=(-Ofast -march=native -g -fomit-frame-pointer -DNDEBUG)
|
local dr_flags=(-Ofast -march=native -mtune=native -g -fomit-frame-pointer -DNDEBUG)
|
||||||
local hardened_flags=(-O3 -march=native -g0 -s
|
local hardened_flags=(-O3 -march=native -mtune=native -g0 -s
|
||||||
-DNDEBUG -D_FORTIFY_SOURCE=2
|
-DNDEBUG -D_FORTIFY_SOURCE=2
|
||||||
-Wformat -Wformat-security -Werror=format-security)
|
-Wformat -Wformat-security -Werror=format-security)
|
||||||
|
|
||||||
|
@ -220,6 +220,8 @@ compile() {
|
||||||
if [ $sepples -eq 0 ] && [[ $flag == -Wextra ]] then
|
if [ $sepples -eq 0 ] && [[ $flag == -Wextra ]] then
|
||||||
# enable some warnings just for C. too annoying in C++.
|
# enable some warnings just for C. too annoying in C++.
|
||||||
warnings+=(-Wshadow -Winline)
|
warnings+=(-Wshadow -Winline)
|
||||||
|
# these ones only work with C.
|
||||||
|
warnings+=(-Wjump-misses-init)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $CC = cl ] && [ $flag = -Wall ]; then
|
if [ $CC = cl ] && [ $flag = -Wall ]; then
|
||||||
|
|
Loading…
Reference in New Issue
Block a user