Debian Codegraph @

debian/patches/0004-src-Makefile-Allow-Werror-to-be-disabled-via-WERROR.patch

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