+2020-03-08 Bruno Haible <bruno@clisp.org>
+
+ *printf-posix: Document why it's overridden on some glibc systems.
+ Reported by Adrian Bunk <bunk@stusta.de> in
+ <https://lists.gnu.org/archive/html/bug-gnulib/2020-03/msg00011.html>.
+ * doc/posix-functions/*printf.texi: Document the problem with the %n
+ directive on some glibc systems.
+ * m4/printf.m4 (gl_PRINTF_DIRECTIVE_N, gl_SNPRINTF_DIRECTIVE_N): Adjust
+ the cross-compilation guesses accordingly.
+
2020-03-07 Paul Eggert <eggert@cs.ucla.edu>
open, openat: port to (O_RDWR | O_RDONLY) != 0
Cygwin 1.5.x, mingw, MSVC 14.
@item
This function does not support the @samp{n} directive on some platforms:
+glibc when used with @code{_FORTIFY_SOURCE >= 2} (set by default on Ubuntu),
MSVC 14.
@item
This function does not support the @samp{ls} directive on some platforms:
Cygwin 1.5.x, mingw, MSVC 14.
@item
This function does not support the @samp{n} directive on some platforms:
+glibc when used with @code{_FORTIFY_SOURCE >= 2} (set by default on Ubuntu),
MSVC 14.
@item
This function does not support the @samp{ls} directive on some platforms:
Cygwin 1.5.x, mingw, MSVC 14.
@item
This function does not support the @samp{n} directive on some platforms:
+glibc when used with @code{_FORTIFY_SOURCE >= 2} (set by default on Ubuntu),
MSVC 14.
@item
This function does not support the @samp{ls} directive on some platforms:
Cygwin 1.5.x, mingw, MSVC 14.
@item
This function does not support the @samp{n} directive on some platforms:
+glibc when used with @code{_FORTIFY_SOURCE >= 2} (set by default on Ubuntu),
MSVC 14.
@item
This function does not support the @samp{ls} directive on some platforms:
MSVC 14.
@item
This function does not support the @samp{n} directive on some platforms:
+glibc when used with @code{_FORTIFY_SOURCE >= 2} (set by default on Ubuntu),
MSVC 14.
@item
On Windows and 32-bit AIX platforms, @code{wchar_t} is a 16-bit type and therefore cannot
Cygwin 1.5.x, mingw, MSVC 14.
@item
This function does not support the @samp{n} directive on some platforms:
+glibc when used with @code{_FORTIFY_SOURCE >= 2} (set by default on Ubuntu),
MSVC 14.
@item
This function does not support the @samp{ls} directive on some platforms:
Cygwin 1.5.x, mingw, MSVC 14.
@item
This function does not support the @samp{n} directive on some platforms:
+glibc when used with @code{_FORTIFY_SOURCE >= 2} (set by default on Ubuntu),
MSVC 14.
@item
This function does not support the @samp{ls} directive on some platforms:
mingw, MSVC 14.
@item
This function does not fully support the @samp{n} directive on some platforms:
+glibc when used with @code{_FORTIFY_SOURCE >= 2} (set by default on Ubuntu),
HP-UX 11, mingw, MSVC 14.
@item
This function overwrites memory even when a zero size argument is passed on some
Cygwin 1.5.x, mingw, MSVC 14.
@item
This function does not support the @samp{n} directive on some platforms:
+glibc when used with @code{_FORTIFY_SOURCE >= 2} (set by default on Ubuntu),
MSVC 14.
@item
This function does not support the @samp{ls} directive on some platforms:
-# printf.m4 serial 62
+# printf.m4 serial 63
dnl Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
[gl_cv_func_printf_directive_n=yes],
[gl_cv_func_printf_directive_n=no],
[case "$host_os" in
+ # Guess no on glibc when _FORTIFY_SOURCE >= 2.
+ *-gnu* | gnu*) AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if _FORTIFY_SOURCE >= 2
+ error fail
+ #endif
+ ]])],
+ [gl_cv_func_printf_directive_n="guessing yes"],
+ [gl_cv_func_printf_directive_n="guessing no"])
+ ;;
# Guess no on Android.
linux*-android*) gl_cv_func_printf_directive_n="guessing no";;
# Guess no on native Windows.
[
changequote(,)dnl
case "$host_os" in
- # Guess yes on glibc systems.
- *-gnu* | gnu*) gl_cv_func_snprintf_directive_n="guessing yes";;
+ # Guess no on glibc when _FORTIFY_SOURCE >= 2.
+ *-gnu* | gnu*) AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if _FORTIFY_SOURCE >= 2
+ error fail
+ #endif
+ ]])],
+ [gl_cv_func_snprintf_directive_n="guessing yes"],
+ [gl_cv_func_snprintf_directive_n="guessing no"])
+ ;;
# Guess yes on musl systems.
*-musl*) gl_cv_func_snprintf_directive_n="guessing yes";;
# Guess yes on FreeBSD >= 5.