libsepol/tests: use more strict compiler options

Use the more strict C compiler warnings from the root Makefile.

Also fail on warnings from the m4 macro processor.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Acked-by: James Carter <jwcart2@gmail.com>
This commit is contained in:
Christian Göttsche 2022-11-14 20:40:30 +01:00 committed by James Carter
parent 42f7f2fdcf
commit c54dd0fab7
2 changed files with 18 additions and 3 deletions

View File

@ -1,9 +1,24 @@
ENV ?= env
M4 ?= m4
M4 ?= m4 -E -E
MKDIR ?= mkdir
EXE ?= libsepol-tests
CFLAGS += -g3 -gdwarf-2 -O0 -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute -Wno-unused-parameter -Werror
CFLAGS += -g3 -gdwarf-2 -O0 \
-Werror -Wall -Wextra \
-Wfloat-equal \
-Wformat=2 \
-Winit-self \
-Wmissing-format-attribute \
-Wmissing-noreturn \
-Wmissing-prototypes \
-Wnull-dereference \
-Wpointer-arith \
-Wshadow \
-Wstrict-prototypes \
-Wundef \
-Wunused \
-Wwrite-strings \
-fno-common
# Statically link libsepol on the assumption that we are going to
# be testing internal functions.

View File

@ -53,7 +53,7 @@
/* this simply tests whether the passed in role only has its own
* value in its dominates ebitmap */
static void only_dominates_self(policydb_t * p, role_datum_t * role)
static void only_dominates_self(policydb_t * p __attribute__ ((unused)), role_datum_t * role)
{
ebitmap_node_t *tnode;
unsigned int i;