From: Dale Richards Date: Thu, 3 Sep 2026 14:33:20 +0100 Subject: src/Makefile: Allow -Werror to be disabled via WERROR The build unconditionally appends -Werror to CFLAGS. This means that any new diagnostic emitted by a newer compiler or system library turns an otherwise harmless warning into a fatal build failure for distributions, which rebuild against moving toolchains (see Debian bug #1128528, an FTBFS caused by the ISO C23 const-qualified return types introduced in glibc 2.43). Keep -Werror on by default for upstream development, but make it a variable so that downstreams can build with "make WERROR=". Forwarded: https://github.com/geoffreybennett/alsa-scarlett-gui/pull/263 Bug-Debian: https://bugs.debian.org/1128528 Last-Update: 2026-09-03 --- src/Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile --- a/src/Makefile +++ b/src/Makefile @@ -33,7 +33,13 @@ DEPDIR := .deps DEPFLAGS = -MT $@ -MMD -MP -MF $(DEPDIR)/$*.d CFLAGS ?= -ggdb -fno-omit-frame-pointer -O2 -CFLAGS += -Wall -Werror -fPIE + +# Treat warnings as errors by default, but allow this to be turned off +# (e.g. WERROR= ) so that a new compiler or library version emitting a +# new warning does not turn into a hard build failure for downstreams. +WERROR ?= -Werror + +CFLAGS += -Wall $(WERROR) -fPIE CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 CFLAGS += -DVERSION=\"$(VERSION)\" CFLAGS += -Wno-error=deprecated-declarations