From 07ed3ac992d5086dcd47273236ad72e496d9620f Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Thu, 5 Aug 2021 12:44:41 +0100 Subject: Separate gcc specific warnings --- .vars.rc.do | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to '.vars.rc.do') diff --git a/.vars.rc.do b/.vars.rc.do index 153a20c..a5521e6 100755 --- a/.vars.rc.do +++ b/.vars.rc.do @@ -10,8 +10,7 @@ CFLAGS=(-std=c11 -fPIC) warnings=( -Wall -Wcast-align -Wcast-qual -Wextra -Wpedantic -Wformat=2 -Winit-self -Wmissing-prototypes -Wpointer-arith -Wshadow - -Wstrict-prototypes -Wsuggest-attribute=format - -Wsuggest-attribute=noreturn + -Wstrict-prototypes ) declare -a CFLAGS CPPFLAGS LDFLAGS LDLIBS @@ -53,6 +52,9 @@ if [[ $optimise ]]; then fi if [[ $warn ]]; then CFLAGS+=("${warnings[@]}") + if [[ $warn = 'gcc' ]]; then + CFLAGS+=(-Wsuggest-attribute=format -Wsuggest-attribute=noreturn) + fi fi if [[ $werror ]]; then CFLAGS+=(-Werror) -- cgit v1.2.3-54-g00ecf