1From 88c78901503d50d0a62d85c96994ca4d67ab61e0 Mon Sep 17 00:00:00 2001 2From: Fabrice Fontaine <fontaine.fabrice@gmail.com> 3Date: Fri, 13 Nov 2020 20:50:27 +0100 4Subject: [PATCH] Add an option to disable -Werror 5 6Allow the user to disable -Werror to avoid the following build failure 7with gcc 4.8: 8 9libtac/lib/magic.c:138:13: error: ignoring return value of 'read', declared with attribute warn_unused_result [-Werror=unused-result] 10 (void) read(rfd, &seed, sizeof(seed)); 11 ^ 12 13Fixes: 14 - http://autobuild.buildroot.org/results/5c17226f12eba104d907693ec37fc101cc6d447f 15 16Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> 17--- 18 Makefile.am | 6 +++++- 19 configure.ac | 3 +++ 20 2 files changed, 8 insertions(+), 1 deletion(-) 21 22diff --git a/Makefile.am b/Makefile.am 23index 0be3cdb..4a137e9 100644 24--- a/Makefile.am 25+++ b/Makefile.am 26@@ -8,7 +8,11 @@ 27 28 ACLOCAL_AMFLAGS = -I config 29 AUTOMAKE_OPTIONS = subdir-objects 30-AM_CFLAGS = -Wall -Wextra -Werror 31+AM_CFLAGS = -Wall -Wextra 32+ 33+if ENABLE_WERROR 34+AM_CFLAGS += -Werror 35+endif 36 37 if TACC 38 bin_PROGRAMS = tacc 39diff --git a/configure.ac b/configure.ac 40index d0c5eba..dd8a966 100644 41--- a/configure.ac 42+++ b/configure.ac 43@@ -100,6 +100,9 @@ AC_SUBST(pamdir) 44 AC_ARG_ENABLE(doc, AS_HELP_STRING([--disable-doc], [do not build docs])) 45 AM_CONDITIONAL(DOC, test "x$enable_doc" != "xno") 46 47+AC_ARG_ENABLE(werror, AS_HELP_STRING([--disable-werror], [do not build with -Werror])) 48+AM_CONDITIONAL(ENABLE_WERROR, test "x$enable_werror" != "xno") 49+ 50 dnl -------------------------------------------------------------------- 51 dnl Switch for run-time debugging 52 AC_ARG_ENABLE(runtime-debugging, [AS_HELP_STRING([--enable-runtime-debugging], 53-- 542.28.0 55 56