summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <pwithnall@gnome.org>2023-12-04 13:02:48 +0000
committerPhilip Withnall <pwithnall@gnome.org>2023-12-04 13:12:21 +0000
commit14a32bd8f477237031a5e10856d0d6789d5509dc (patch)
tree3457985b642a99c66f0ebb825abd3cd22dae8917
parent2699498639aeb0d323ca3484b5ae580e4724fffb (diff)
build: Enable -Werror=sign-compare
xdgmime is a low-level library which uses pointer arithmetic in conjunction with reading user-controlled files. We definitely want to make sure the code is arithmetically correct. Signed-off-by: Philip Withnall <pwithnall@gnome.org>
-rw-r--r--meson.build2
-rw-r--r--src/Makefile2
2 files changed, 2 insertions, 2 deletions
diff --git a/meson.build b/meson.build
index 2b16fda..ef83b2a 100644
--- a/meson.build
+++ b/meson.build
@@ -9,7 +9,7 @@ add_project_arguments(
'-DXDG_PREFIX=xdg_test',
'-DHAVE_MMAP',
'-Wmissing-prototypes',
- '-Wno-sign-compare',
+ '-Werror=sign-compare',
language: 'c',
native: true,
)
diff --git a/src/Makefile b/src/Makefile
index 44c44f7..c2a9a76 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -2,7 +2,7 @@
.PHONY: all clean
C_STD = -std=c99 -D_POSIX_C_SOURCE=200809L
-ALL_CFLAGS = $(C_STD) -c -g -DXDG_PREFIX=xdg_test -DHAVE_MMAP -Wall -Wmissing-prototypes -Wno-sign-compare $(CFLAGS)
+ALL_CFLAGS = $(C_STD) -c -g -DXDG_PREFIX=xdg_test -DHAVE_MMAP -Wall -Wmissing-prototypes -Werror=sign-compare $(CFLAGS)
.c.o:
$(CC) $(ALL_CFLAGS) -o $@ $<