0001-Add-an-option-to-disable-Werror.patch 1.7 KB

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