diff --git a/Makefile b/Makefile index 54e4379..8a1dd41 100644 --- a/Makefile +++ b/Makefile @@ -12,11 +12,11 @@ SRC = $(wildcard *.c) # -Wall to get all the possible warnings # -ansi -pendantic to get portable code ifeq ($(DEBUG),yes) - CFLAGS=-W -Wall -ansi -pedantic -g -std=c99 - LDFLAGS= -Wall -lm + CFLAGS=-W -Werror=unused-variable -Wall -ansi -pedantic -g -std=c99 + LDFLAGS= -Werror=unused-variable -Wall -lm else - CFLAGS=-W -Wall -ansi -pedantic -std=c99 -O3 - LDFLAGS= -Wall -lm + CFLAGS=-W -Werror=unused-variable -Wall -ansi -pedantic -std=c99 -O3 + LDFLAGS= -Werror=unused-variable -Wall -lm endif ############################################### diff --git a/main.c b/main.c index 3261136..f501c1b 100644 --- a/main.c +++ b/main.c @@ -1,9 +1,10 @@ #include #include "dependency.h" +// Demo for CI Pipeline autofix int main(void) { - uint8_t foo = 5; /* unused variable */ + uint8_t foo __attribute__((unused)) = 5; /* intentionally unused variable */ dependency(); return 0; }