From d95df5028d37b6d347e3afcdb349c182b0a6ce4c Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 31 Jul 2022 11:54:12 -0700 Subject: [PATCH 3/5] maint: improve Gnulib checking * configure.ac: With --enable-gcc-warnings, #define lint, _FORTIFY_SOURCE, and GNULIB_PORT_CHECK, to better check Gnulib. --- configure.ac | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/configure.ac b/configure.ac index 08ea7cdf..442874d6 100644 --- a/configure.ac +++ b/configure.ac @@ -226,6 +226,16 @@ if test "$enable_gcc_warnings" = yes; then gl_WARN_ADD([-Wno-deprecated], [WNO_DEPRECATED_CXXFLAGS]) CXXFLAGS=$save_CXXFLAGS AC_LANG_POP([C++]) + + AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.]) + AH_VERBATIM([FORTIFY_SOURCE], + [/* Enable compile-time and run-time bounds-checking, and some warnings, + without upsetting glibc 2.15+. */ + #if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__ + # define _FORTIFY_SOURCE 2 + #endif + ]) + AC_DEFINE([GNULIB_PORTCHECK], [1], [Enable some gnulib portability checks.]) fi -- 2.34.1