aboutsummaryrefslogtreecommitdiff
path: root/bfd/warning.m4
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/warning.m4')
-rw-r--r--bfd/warning.m44
1 files changed, 4 insertions, 0 deletions
diff --git a/bfd/warning.m4 b/bfd/warning.m4
index 028d079..4c5b55d 100644
--- a/bfd/warning.m4
+++ b/bfd/warning.m4
@@ -30,6 +30,9 @@ AC_EGREP_CPP([^[0-3]$],[__GNUC__],,GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wshadow")
# Add -Wstack-usage if the compiler is a sufficiently recent version of GCC.
AC_EGREP_CPP([^[0-4]$],[__GNUC__],,GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wstack-usage=262144")
+# Set WARN_WRITE_STRINGS if the compiler supports -Wwrite-strings.
+WARN_WRITE_STRINGS=""
+AC_EGREP_CPP([^[0-3]$],[__GNUC__],,WARN_WRITE_STRINGS="-Wwrite-strings")
AC_ARG_ENABLE(werror,
[ --enable-werror treat compile warnings as errors],
@@ -84,4 +87,5 @@ fi
AC_SUBST(WARN_CFLAGS)
AC_SUBST(NO_WERROR)
+ AC_SUBST(WARN_WRITE_STRINGS)
])