From f3ee4dbe20cc935edc78d2fcdd37c24130f62e86 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Tue, 27 Apr 2021 17:58:28 +0100 Subject: [PATCH] Remove -Werror from all the default cflags. I've recently been coming round in general to the idea that -Werror is fine for developers and centralised binary builds, but has too many unanticipated failure modes in the field (with everyone's different versions of compilers, headers etc) to leave turned on for the 'just download and build' source tarball that's supposed to work everywhere. On main, I've already made the change to hide it behind a cmake 'strict' setting. In particular, I've just done pre-release build tests with various versions of GTK, which reminded me that the GTK 2 installation on Ubuntu 20.04 fails to build at -Werror, because GTK's own header files have a warning-generating inconsistency. (glib/gtypes.h declares GTimeVal as deprecated, and then gtk/gtktooltips.h uses it anyway.) Clearly this is the kind of thing that ought not to break the build of a client application! --- configure.ac | 4 ++-- mkfiles.pl | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 72874f32..51ea3691 100644 --- a/configure.ac +++ b/configure.ac @@ -10,7 +10,7 @@ AC_INIT(putty, X.XX) AC_CONFIG_FILES([Makefile]) AC_CONFIG_HEADERS([uxconfig.h:uxconfig.in]) -AM_INIT_AUTOMAKE([-Wall -Werror foreign]) +AM_INIT_AUTOMAKE([-Wall foreign]) AC_PROG_INSTALL AC_PROG_RANLIB @@ -198,7 +198,7 @@ AS_IF([test AS_VAR_GET(x_cv_linux_so_peercred) = yes], if test "x$GCC" = "xyes"; then : - AC_SUBST(WARNINGOPTS, ['-Wall -Werror -Wpointer-arith -Wvla']) + AC_SUBST(WARNINGOPTS, ['-Wall -Wpointer-arith -Wvla']) else : AC_SUBST(WARNINGOPTS, []) diff --git a/mkfiles.pl b/mkfiles.pl index 3282f359..b323e87f 100755 --- a/mkfiles.pl +++ b/mkfiles.pl @@ -549,7 +549,7 @@ if (defined $makefiles{'clangcl'}) { (join " ", map {"-I$dirpfx$_"} @srcdirs) . " /D_WINDOWS /D_WIN32_WINDOWS=0x500 /DWINVER=0x500 ". "/D_CRT_SECURE_NO_WARNINGS /D_WINSOCK_DEPRECATED_NO_WARNINGS"). - " -Werror \$(PLATFORMCFLAGS)\n". + " \$(PLATFORMCFLAGS)\n". "LFLAGS = /incremental:no /dynamicbase /nxcompat\n". &splitline("RCPPFLAGS = ".(join " ", map {"-I$dirpfx$_"} @srcdirs). " -DWIN32 -D_WIN32 -DWINVER=0x0400")." \$(RCFL)\n". @@ -1425,7 +1425,7 @@ if (defined $makefiles{'gtk'}) { "\n". "unexport CFLAGS # work around a weird issue with krb5-config\n". "\n". - &splitline("CFLAGS = -O2 -Wall -Werror -std=gnu99 -Wvla -g " . + &splitline("CFLAGS = -O2 -Wall -std=gnu99 -Wvla -g " . (join " ", map {"-I$dirpfx$_"} @srcdirs) . " \$(shell \$(GTK_CONFIG) --cflags)"). " -D _FILE_OFFSET_BITS=64\n". @@ -1506,7 +1506,7 @@ if (defined $makefiles{'unix'}) { "\n". "unexport CFLAGS # work around a weird issue with krb5-config\n". "\n". - &splitline("CFLAGS = -O2 -Wall -Werror -std=gnu99 -Wvla -g " . + &splitline("CFLAGS = -O2 -Wall -std=gnu99 -Wvla -g " . (join " ", map {"-I$dirpfx$_"} @srcdirs)). " -D _FILE_OFFSET_BITS=64\n". "ULDFLAGS = \$(LDFLAGS)\n". @@ -1748,7 +1748,7 @@ if (defined $makefiles{'osx'}) { print "CC = \$(TOOLPATH)gcc\n". "\n". - &splitline("CFLAGS = -O2 -Wall -Werror -std=gnu99 -Wvla -g " . + &splitline("CFLAGS = -O2 -Wall -std=gnu99 -Wvla -g " . (join " ", map {"-I$dirpfx$_"} @srcdirs))."\n". "MLDFLAGS = -framework Cocoa\n". "ULDFLAGS =\n".