Skip to content

[th/gcc-14-fixes] fix compiler warnings with gcc-14 (mostly "-Wnonnull-compare")

Thomas Haller requested to merge th/gcc-14-fixes into main

copr builds on rawhide are broken, because of new compiler warnings on gcc 14.0.1-0.2.fc40

Address them.

Actually, the compiler warnings from systemd are not addressed. The systemd code needs to be re-imported, and seen that the warnings are fixed in systemd upstream. The workaround would be

diff --git c/Makefile.am w/Makefile.am
index 4a4ea6162822..2783e9990c79 100644
--- c/Makefile.am
+++ w/Makefile.am
@@ -2306,6 +2306,8 @@ libsystemd_cppflags = \
 	-I$(srcdir)/src/libnm-systemd-shared/src/fundamental \
 	-I$(srcdir)/src/libnm-systemd-shared/src/shared \
 	$(LIBSYSTEMD_NM_CFLAGS) \
+	-Wno-error=nonnull-compare \
+	-Wno-error=calloc-transposed-args \
 	$(GLIB_CFLAGS) \
 	$(CODE_COVERAGE_CFLAGS) \
 	$(NULL)

Merge request reports