Commit 4bff1f4b authored by Vladimír Čunát's avatar Vladimír Čunát Committed by Tomas Krizek

CI: enforce -Wpedantic and -Wshadow

-Wpedantic is only enforced in CI, as we only have it fixed with c11
standard, and I didn't want to force c11 dependency for everyone yet.
parent df495c86
...@@ -41,20 +41,30 @@ stages: ...@@ -41,20 +41,30 @@ stages:
build:linux:amd64: build:linux:amd64:
<<: *build <<: *build
build:clang:linux:amd64:
<<: *build
variables:
CFLAGS: -Werror -Wno-error=unused-command-line-argument -ggdb
CXX: clang++
CC: clang
image: $CI_REGISTRY/knot/knot-resolver/ci/debian-unstable:knot-2.7 # newer Debian for newer Clang
artifacts:
build:asan:linux:amd64: build:asan:linux:amd64:
<<: *build <<: *build
variables: variables:
CFLAGS: -Werror -ggdb3 -O0 -fsanitize=address -fno-omit-frame-pointer CFLAGS: -Werror -ggdb3 -O0 -fsanitize=address -fno-omit-frame-pointer
lint:pedantic:
stage: test # could be in build already, but let's not block the test stage if this fails
dependencies: [] # do not download build artifacts
except:
- master
image: $CI_REGISTRY/knot/knot-resolver/ci/debian-unstable:knot-2.7 # newer Debian for newer compilers
variables:
CFLAGS: -Werror -Wall -Wpedantic -ggdb -std=gnu11
script:
- make -k all
- make clean
- make -k all CC=clang CXX=clang++ \
CFLAGS="$CFLAGS -Wno-newline-eof -Wno-gnu-zero-variadic-macro-arguments -Wno-gnu-folding-constant"
tags:
- docker
- linux
- amd64
srpm: srpm:
stage: build stage: build
except: except:
......
...@@ -34,8 +34,8 @@ INSTALL := install ...@@ -34,8 +34,8 @@ INSTALL := install
# Flags # Flags
BUILD_LDFLAGS += $(LDFLAGS) BUILD_LDFLAGS += $(LDFLAGS)
BUILD_CFLAGS := $(CFLAGS) $(CPPFLAGS) -std=c99 -D_GNU_SOURCE BUILD_CFLAGS := -std=c99 -D_GNU_SOURCE $(CFLAGS) $(CPPFLAGS)
BUILD_CFLAGS += -Wno-unused -Wtype-limits -Wformat -Wformat-security -Wall BUILD_CFLAGS += -Wtype-limits -Wformat -Wformat-security -Wshadow -Wall
BUILD_CFLAGS += -I$(abspath .) -I$(abspath lib/generic) -I$(abspath contrib) BUILD_CFLAGS += -I$(abspath .) -I$(abspath lib/generic) -I$(abspath contrib)
BUILD_CFLAGS += -DPACKAGE_VERSION="\"$(VERSION)\"" -DPREFIX="\"$(PREFIX)\"" -DMODULEDIR="\"$(MODULEDIR)\"" BUILD_CFLAGS += -DPACKAGE_VERSION="\"$(VERSION)\"" -DPREFIX="\"$(PREFIX)\"" -DMODULEDIR="\"$(MODULEDIR)\""
BUILD_CFLAGS += -fvisibility=hidden BUILD_CFLAGS += -fvisibility=hidden
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment