diff options
| author | Paul Eggert | 2019-10-21 17:28:02 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-10-21 17:33:18 -0700 |
| commit | 3716921c012d7b21a9b0d593a7ea0ddd1e860cfd (patch) | |
| tree | 7d2fa61ff9520896c5c02ad3aed1c905c8906823 | |
| parent | b087a5f3e4a7fff586245c117f153ae50a35537c (diff) | |
| download | emacs-3716921c012d7b21a9b0d593a7ea0ddd1e860cfd.tar.gz emacs-3716921c012d7b21a9b0d593a7ea0ddd1e860cfd.zip | |
Portcheck only if --enable-gcc-warnings
Problem reported by Richard Copley (Bug#37852).
This patch causes the problem to not occur if one uses plain
‘configure’. The problem can still occur if with ‘configure
--enable-gcc-warnings’, so a further fix may be needed.
* configure.ac (GNULIB_PORTCHECK, _FORTIFY_SOURCE):
Define these only with an explicit --enable-gcc-warnings.
| -rw-r--r-- | configure.ac | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac index 33d725c8046..3b6a2a6d167 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -1114,15 +1114,16 @@ AS_IF([test $gl_gcc_warnings = no], | |||
| 1114 | fi | 1114 | fi |
| 1115 | 1115 | ||
| 1116 | AC_DEFINE([GCC_LINT], [1], [Define to 1 if --enable-gcc-warnings.]) | 1116 | AC_DEFINE([GCC_LINT], [1], [Define to 1 if --enable-gcc-warnings.]) |
| 1117 | AC_DEFINE([GNULIB_PORTCHECK], [1], [enable some gnulib portability checks]) | 1117 | AS_IF([test $gl_gcc_warnings = yes], |
| 1118 | AH_VERBATIM([GNULIB_PORTCHECK_FORTIFY_SOURCE], | 1118 | [AC_DEFINE([GNULIB_PORTCHECK], [1], [enable some gnulib portability checks]) |
| 1119 | [/* Enable compile-time and run-time bounds-checking, and some warnings, | 1119 | AH_VERBATIM([GNULIB_PORTCHECK_FORTIFY_SOURCE], |
| 1120 | without upsetting glibc 2.15+. */ | 1120 | [/* Enable compile-time and run-time bounds-checking, and some warnings, |
| 1121 | #if (defined GNULIB_PORTCHECK && !defined _FORTIFY_SOURCE \ | 1121 | without upsetting glibc 2.15+. */ |
| 1122 | && defined __OPTIMIZE__ && __OPTIMIZE__) | 1122 | #if (defined GNULIB_PORTCHECK && !defined _FORTIFY_SOURCE \ |
| 1123 | # define _FORTIFY_SOURCE 2 | 1123 | && defined __OPTIMIZE__ && __OPTIMIZE__) |
| 1124 | #endif | 1124 | # define _FORTIFY_SOURCE 2 |
| 1125 | ]) | 1125 | #endif |
| 1126 | ])]) | ||
| 1126 | ]) | 1127 | ]) |
| 1127 | 1128 | ||
| 1128 | # clang is picky about these regardless of whether | 1129 | # clang is picky about these regardless of whether |