2N/A# printf.m4 serial 35
2N/Adnl Copyright (C) 2003, 2007-2010 Free Software Foundation, Inc.
2N/Adnl This file is free software; the Free Software Foundation
2N/Adnl gives unlimited permission to copy and/or distribute it,
2N/Adnl with or without modifications, as long as this notice is preserved.
2N/A
2N/Adnl Test whether the *printf family of functions supports the 'j', 'z', 't',
2N/Adnl 'L' size specifiers. (ISO C99, POSIX:2001)
2N/Adnl Result is gl_cv_func_printf_sizes_c99.
2N/A
2N/AAC_DEFUN([gl_PRINTF_SIZES_C99],
2N/A[
2N/A AC_REQUIRE([AC_PROG_CC])
2N/A AC_REQUIRE([gl_AC_HEADER_STDINT_H])
2N/A AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
2N/A AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
2N/A AC_CACHE_CHECK([whether printf supports size specifiers as in C99],
2N/A [gl_cv_func_printf_sizes_c99],
2N/A [
2N/A AC_RUN_IFELSE(
2N/A [AC_LANG_SOURCE([[
2N/A#include <stddef.h>
2N/A#include <stdio.h>
2N/A#include <string.h>
2N/A#include <sys/types.h>
2N/A#if HAVE_STDINT_H_WITH_UINTMAX
2N/A# include <stdint.h>
2N/A#endif
2N/A#if HAVE_INTTYPES_H_WITH_UINTMAX
2N/A# include <inttypes.h>
2N/A#endif
2N/Astatic char buf[100];
2N/Aint main ()
2N/A{
2N/A#if HAVE_STDINT_H_WITH_UINTMAX || HAVE_INTTYPES_H_WITH_UINTMAX
2N/A buf[0] = '\0';
2N/A if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0
2N/A || strcmp (buf, "12345671 33") != 0)
2N/A return 1;
2N/A#endif
2N/A buf[0] = '\0';
2N/A if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0
2N/A || strcmp (buf, "12345672 33") != 0)
2N/A return 1;
2N/A buf[0] = '\0';
2N/A if (sprintf (buf, "%tu %d", (ptrdiff_t) 12345673, 33, 44, 55) < 0
2N/A || strcmp (buf, "12345673 33") != 0)
2N/A return 1;
2N/A buf[0] = '\0';
2N/A if (sprintf (buf, "%Lg %d", (long double) 1.5, 33, 44, 55) < 0
2N/A || strcmp (buf, "1.5 33") != 0)
2N/A return 1;
2N/A return 0;
2N/A}]])],
2N/A [gl_cv_func_printf_sizes_c99=yes],
2N/A [gl_cv_func_printf_sizes_c99=no],
2N/A [
2N/Achangequote(,)dnl
2N/A case "$host_os" in
2N/A # Guess yes on glibc systems.
2N/A *-gnu*) gl_cv_func_printf_sizes_c99="guessing yes";;
2N/A # Guess yes on FreeBSD >= 5.
2N/A freebsd[1-4]*) gl_cv_func_printf_sizes_c99="guessing no";;
2N/A freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
2N/A # Guess yes on MacOS X >= 10.3.
2N/A darwin[1-6].*) gl_cv_func_printf_sizes_c99="guessing no";;
2N/A darwin*) gl_cv_func_printf_sizes_c99="guessing yes";;
2N/A # Guess yes on OpenBSD >= 3.9.
2N/A openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
2N/A gl_cv_func_printf_sizes_c99="guessing no";;
2N/A openbsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
2N/A # Guess yes on Solaris >= 2.10.
2N/A solaris2.[0-9]*) gl_cv_func_printf_sizes_c99="guessing no";;
2N/A solaris*) gl_cv_func_printf_sizes_c99="guessing yes";;
2N/A # Guess yes on NetBSD >= 3.
2N/A netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
2N/A gl_cv_func_printf_sizes_c99="guessing no";;
2N/A netbsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
2N/A # If we don't know, assume the worst.
2N/A *) gl_cv_func_printf_sizes_c99="guessing no";;
2N/A esac
2N/Achangequote([,])dnl
2N/A ])
2N/A ])
2N/A])
2N/A
2N/Adnl Test whether the *printf family of functions supports 'long double'
2N/Adnl arguments together with the 'L' size specifier. (ISO C99, POSIX:2001)
2N/Adnl Result is gl_cv_func_printf_long_double.
2N/A
2N/AAC_DEFUN([gl_PRINTF_LONG_DOUBLE],
2N/A[
2N/A AC_REQUIRE([AC_PROG_CC])
2N/A AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
2N/A AC_CACHE_CHECK([whether printf supports 'long double' arguments],
2N/A [gl_cv_func_printf_long_double],
2N/A [
2N/A AC_RUN_IFELSE(
2N/A [AC_LANG_SOURCE([[
2N/A#include <stdio.h>
2N/A#include <string.h>
2N/Astatic char buf[10000];
2N/Aint main ()
2N/A{
2N/A buf[0] = '\0';
2N/A if (sprintf (buf, "%Lf %d", 1.75L, 33, 44, 55) < 0
2N/A || strcmp (buf, "1.750000 33") != 0)
2N/A return 1;
2N/A buf[0] = '\0';
2N/A if (sprintf (buf, "%Le %d", 1.75L, 33, 44, 55) < 0
2N/A || strcmp (buf, "1.750000e+00 33") != 0)
2N/A return 1;
2N/A buf[0] = '\0';
2N/A if (sprintf (buf, "%Lg %d", 1.75L, 33, 44, 55) < 0
2N/A || strcmp (buf, "1.75 33") != 0)
2N/A return 1;
2N/A return 0;
2N/A}]])],
2N/A [gl_cv_func_printf_long_double=yes],
2N/A [gl_cv_func_printf_long_double=no],
2N/A [
2N/Achangequote(,)dnl
2N/A case "$host_os" in
2N/A beos*) gl_cv_func_printf_long_double="guessing no";;
2N/A mingw* | pw*) gl_cv_func_printf_long_double="guessing no";;
2N/A *) gl_cv_func_printf_long_double="guessing yes";;
2N/A esac
2N/Achangequote([,])dnl
2N/A ])
2N/A ])
2N/A])
2N/A
2N/Adnl Test whether the *printf family of functions supports infinite and NaN
2N/Adnl 'double' arguments and negative zero arguments in the %f, %e, %g
2N/Adnl directives. (ISO C99, POSIX:2001)
2N/Adnl Result is gl_cv_func_printf_infinite.
2N/A
2N/AAC_DEFUN([gl_PRINTF_INFINITE],
2N/A[
2N/A AC_REQUIRE([AC_PROG_CC])
2N/A AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
2N/A AC_CACHE_CHECK([whether printf supports infinite 'double' arguments],
2N/A [gl_cv_func_printf_infinite],
2N/A [
2N/A AC_RUN_IFELSE(
2N/A [AC_LANG_SOURCE([[
2N/A#include <stdio.h>
2N/A#include <string.h>
2N/Astatic int
2N/Astrisnan (const char *string, size_t start_index, size_t end_index)
2N/A{
2N/A if (start_index < end_index)
2N/A {
2N/A if (string[start_index] == '-')
2N/A start_index++;
2N/A if (start_index + 3 <= end_index
2N/A && memcmp (string + start_index, "nan", 3) == 0)
2N/A {
2N/A start_index += 3;
2N/A if (start_index == end_index
2N/A || (string[start_index] == '(' && string[end_index - 1] == ')'))
2N/A return 1;
2N/A }
2N/A }
2N/A return 0;
2N/A}
2N/Astatic int
2N/Ahave_minus_zero ()
2N/A{
2N/A static double plus_zero = 0.0;
2N/A double minus_zero = - plus_zero;
2N/A return memcmp (&plus_zero, &minus_zero, sizeof (double)) != 0;
2N/A}
2N/Astatic char buf[10000];
2N/Astatic double zero = 0.0;
2N/Aint main ()
2N/A{
2N/A if (sprintf (buf, "%f", 1.0 / 0.0) < 0
2N/A || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
2N/A return 1;
2N/A if (sprintf (buf, "%f", -1.0 / 0.0) < 0
2N/A || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
2N/A return 1;
2N/A if (sprintf (buf, "%f", zero / zero) < 0
2N/A || !strisnan (buf, 0, strlen (buf)))
2N/A return 1;
2N/A if (sprintf (buf, "%e", 1.0 / 0.0) < 0
2N/A || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
2N/A return 1;
2N/A if (sprintf (buf, "%e", -1.0 / 0.0) < 0
2N/A || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
2N/A return 1;
2N/A if (sprintf (buf, "%e", zero / zero) < 0
2N/A || !strisnan (buf, 0, strlen (buf)))
2N/A return 1;
2N/A if (sprintf (buf, "%g", 1.0 / 0.0) < 0
2N/A || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
2N/A return 1;
2N/A if (sprintf (buf, "%g", -1.0 / 0.0) < 0
2N/A || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
2N/A return 1;
2N/A if (sprintf (buf, "%g", zero / zero) < 0
2N/A || !strisnan (buf, 0, strlen (buf)))
2N/A return 1;
2N/A /* This test fails on HP-UX 10.20. */
2N/A if (have_minus_zero ())
2N/A if (sprintf (buf, "%g", - zero) < 0
2N/A || strcmp (buf, "-0") != 0)
2N/A return 1;
2N/A return 0;
2N/A}]])],
2N/A [gl_cv_func_printf_infinite=yes],
2N/A [gl_cv_func_printf_infinite=no],
2N/A [
2N/Achangequote(,)dnl
2N/A case "$host_os" in
2N/A # Guess yes on glibc systems.
2N/A *-gnu*) gl_cv_func_printf_infinite="guessing yes";;
2N/A # Guess yes on FreeBSD >= 6.
2N/A freebsd[1-5]*) gl_cv_func_printf_infinite="guessing no";;
2N/A freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";;
2N/A # Guess yes on MacOS X >= 10.3.
2N/A darwin[1-6].*) gl_cv_func_printf_infinite="guessing no";;
2N/A darwin*) gl_cv_func_printf_infinite="guessing yes";;
2N/A # Guess yes on HP-UX >= 11.
2N/A hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";;
2N/A hpux*) gl_cv_func_printf_infinite="guessing yes";;
2N/A # Guess yes on NetBSD >= 3.
2N/A netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
2N/A gl_cv_func_printf_infinite="guessing no";;
2N/A netbsd*) gl_cv_func_printf_infinite="guessing yes";;
2N/A # Guess yes on BeOS.
2N/A beos*) gl_cv_func_printf_infinite="guessing yes";;
2N/A # If we don't know, assume the worst.
2N/A *) gl_cv_func_printf_infinite="guessing no";;
2N/A esac
2N/Achangequote([,])dnl
2N/A ])
2N/A ])
2N/A])
2N/A
2N/Adnl Test whether the *printf family of functions supports infinite and NaN
2N/Adnl 'long double' arguments in the %f, %e, %g directives. (ISO C99, POSIX:2001)
2N/Adnl Result is gl_cv_func_printf_infinite_long_double.
2N/A
2N/AAC_DEFUN([gl_PRINTF_INFINITE_LONG_DOUBLE],
2N/A[
2N/A AC_REQUIRE([gl_PRINTF_LONG_DOUBLE])
2N/A AC_REQUIRE([AC_PROG_CC])
2N/A AC_REQUIRE([gl_BIGENDIAN])
2N/A AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
2N/A dnl The user can set or unset the variable gl_printf_safe to indicate
2N/A dnl that he wishes a safe handling of non-IEEE-754 'long double' values.
2N/A if test -n "$gl_printf_safe"; then
2N/A AC_DEFINE([CHECK_PRINTF_SAFE], [1],
2N/A [Define if you wish *printf() functions that have a safe handling of
2N/A non-IEEE-754 'long double' values.])
2N/A fi
2N/A case "$gl_cv_func_printf_long_double" in
2N/A *yes)
2N/A AC_CACHE_CHECK([whether printf supports infinite 'long double' arguments],
2N/A [gl_cv_func_printf_infinite_long_double],
2N/A [
2N/A AC_RUN_IFELSE(
2N/A [AC_LANG_SOURCE([[
2N/A]GL_NOCRASH[
2N/A#include <float.h>
2N/A#include <stdio.h>
2N/A#include <string.h>
2N/Astatic int
2N/Astrisnan (const char *string, size_t start_index, size_t end_index)
2N/A{
2N/A if (start_index < end_index)
2N/A {
2N/A if (string[start_index] == '-')
2N/A start_index++;
2N/A if (start_index + 3 <= end_index
2N/A && memcmp (string + start_index, "nan", 3) == 0)
2N/A {
2N/A start_index += 3;
2N/A if (start_index == end_index
2N/A || (string[start_index] == '(' && string[end_index - 1] == ')'))
2N/A return 1;
2N/A }
2N/A }
2N/A return 0;
2N/A}
2N/Astatic char buf[10000];
2N/Astatic long double zeroL = 0.0L;
2N/Aint main ()
2N/A{
2N/A nocrash_init();
2N/A if (sprintf (buf, "%Lf", 1.0L / 0.0L) < 0
2N/A || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
2N/A return 1;
2N/A if (sprintf (buf, "%Lf", -1.0L / 0.0L) < 0
2N/A || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
2N/A return 1;
2N/A if (sprintf (buf, "%Lf", zeroL / zeroL) < 0
2N/A || !strisnan (buf, 0, strlen (buf)))
2N/A return 1;
2N/A if (sprintf (buf, "%Le", 1.0L / 0.0L) < 0
2N/A || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
2N/A return 1;
2N/A if (sprintf (buf, "%Le", -1.0L / 0.0L) < 0
2N/A || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
2N/A return 1;
2N/A if (sprintf (buf, "%Le", zeroL / zeroL) < 0
2N/A || !strisnan (buf, 0, strlen (buf)))
2N/A return 1;
2N/A if (sprintf (buf, "%Lg", 1.0L / 0.0L) < 0
2N/A || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
2N/A return 1;
2N/A if (sprintf (buf, "%Lg", -1.0L / 0.0L) < 0
2N/A || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
2N/A return 1;
2N/A if (sprintf (buf, "%Lg", zeroL / zeroL) < 0
2N/A || !strisnan (buf, 0, strlen (buf)))
2N/A return 1;
2N/A#if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_))
2N/A/* Representation of an 80-bit 'long double' as an initializer for a sequence
2N/A of 'unsigned int' words. */
2N/A# ifdef WORDS_BIGENDIAN
2N/A# define LDBL80_WORDS(exponent,manthi,mantlo) \
2N/A { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \
2N/A ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \
2N/A (unsigned int) (mantlo) << 16 \
2N/A }
2N/A# else
2N/A# define LDBL80_WORDS(exponent,manthi,mantlo) \
2N/A { mantlo, manthi, exponent }
2N/A# endif
2N/A { /* Quiet NaN. */
2N/A static union { unsigned int word[4]; long double value; } x =
2N/A { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
2N/A if (sprintf (buf, "%Lf", x.value) < 0
2N/A || !strisnan (buf, 0, strlen (buf)))
2N/A return 1;
2N/A if (sprintf (buf, "%Le", x.value) < 0
2N/A || !strisnan (buf, 0, strlen (buf)))
2N/A return 1;
2N/A if (sprintf (buf, "%Lg", x.value) < 0
2N/A || !strisnan (buf, 0, strlen (buf)))
2N/A return 1;
2N/A }
2N/A {
2N/A /* Signalling NaN. */
2N/A static union { unsigned int word[4]; long double value; } x =
2N/A { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
2N/A if (sprintf (buf, "%Lf", x.value) < 0
2N/A || !strisnan (buf, 0, strlen (buf)))
2N/A return 1;
2N/A if (sprintf (buf, "%Le", x.value) < 0
2N/A || !strisnan (buf, 0, strlen (buf)))
2N/A return 1;
2N/A if (sprintf (buf, "%Lg", x.value) < 0
2N/A || !strisnan (buf, 0, strlen (buf)))
2N/A return 1;
2N/A }
2N/A { /* Pseudo-NaN. */
2N/A static union { unsigned int word[4]; long double value; } x =
2N/A { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
2N/A if (sprintf (buf, "%Lf", x.value) < 0
2N/A || !strisnan (buf, 0, strlen (buf)))
2N/A return 1;
2N/A if (sprintf (buf, "%Le", x.value) < 0
2N/A || !strisnan (buf, 0, strlen (buf)))
2N/A return 1;
2N/A if (sprintf (buf, "%Lg", x.value) < 0
2N/A || !strisnan (buf, 0, strlen (buf)))
2N/A return 1;
2N/A }
2N/A { /* Pseudo-Infinity. */
2N/A static union { unsigned int word[4]; long double value; } x =
2N/A { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
2N/A if (sprintf (buf, "%Lf", x.value) < 0
2N/A || !strisnan (buf, 0, strlen (buf)))
2N/A return 1;
2N/A if (sprintf (buf, "%Le", x.value) < 0
2N/A || !strisnan (buf, 0, strlen (buf)))
2N/A return 1;
2N/A if (sprintf (buf, "%Lg", x.value) < 0
2N/A || !strisnan (buf, 0, strlen (buf)))
2N/A return 1;
2N/A }
2N/A { /* Pseudo-Zero. */
2N/A static union { unsigned int word[4]; long double value; } x =
2N/A { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
2N/A if (sprintf (buf, "%Lf", x.value) < 0
2N/A || !strisnan (buf, 0, strlen (buf)))
2N/A return 1;
2N/A if (sprintf (buf, "%Le", x.value) < 0
2N/A || !strisnan (buf, 0, strlen (buf)))
2N/A return 1;
2N/A if (sprintf (buf, "%Lg", x.value) < 0
2N/A || !strisnan (buf, 0, strlen (buf)))
2N/A return 1;
2N/A }
2N/A { /* Unnormalized number. */
2N/A static union { unsigned int word[4]; long double value; } x =
2N/A { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
2N/A if (sprintf (buf, "%Lf", x.value) < 0
2N/A || !strisnan (buf, 0, strlen (buf)))
2N/A return 1;
2N/A if (sprintf (buf, "%Le", x.value) < 0
2N/A || !strisnan (buf, 0, strlen (buf)))
2N/A return 1;
2N/A if (sprintf (buf, "%Lg", x.value) < 0
2N/A || !strisnan (buf, 0, strlen (buf)))
2N/A return 1;
2N/A }
2N/A { /* Pseudo-Denormal. */
2N/A static union { unsigned int word[4]; long double value; } x =
2N/A { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
2N/A if (sprintf (buf, "%Lf", x.value) < 0
2N/A || !strisnan (buf, 0, strlen (buf)))
2N/A return 1;
2N/A if (sprintf (buf, "%Le", x.value) < 0
2N/A || !strisnan (buf, 0, strlen (buf)))
2N/A return 1;
2N/A if (sprintf (buf, "%Lg", x.value) < 0
2N/A || !strisnan (buf, 0, strlen (buf)))
2N/A return 1;
2N/A }
2N/A#endif
2N/A return 0;
2N/A}]])],
2N/A [gl_cv_func_printf_infinite_long_double=yes],
2N/A [gl_cv_func_printf_infinite_long_double=no],
2N/A [
2N/Achangequote(,)dnl
2N/A case "$host_cpu" in
2N/A # Guess no on ia64, x86_64, i386.
2N/A ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";;
2N/A *)
2N/A case "$host_os" in
2N/A # Guess yes on glibc systems.
2N/A *-gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";;
2N/A # Guess yes on FreeBSD >= 6.
2N/A freebsd[1-5]*) gl_cv_func_printf_infinite_long_double="guessing no";;
2N/A freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
2N/A # Guess yes on MacOS X >= 10.3.
2N/A darwin[1-6].*) gl_cv_func_printf_infinite_long_double="guessing no";;
2N/A darwin*) gl_cv_func_printf_infinite_long_double="guessing yes";;
2N/A # Guess yes on HP-UX >= 11.
2N/A hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";;
2N/A hpux*) gl_cv_func_printf_infinite_long_double="guessing yes";;
2N/A # Guess yes on NetBSD >= 3.
2N/A netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
2N/A gl_cv_func_printf_infinite_long_double="guessing no";;
2N/A netbsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
2N/A # If we don't know, assume the worst.
2N/A *) gl_cv_func_printf_infinite_long_double="guessing no";;
2N/A esac
2N/A ;;
2N/A esac
2N/Achangequote([,])dnl
2N/A ])
2N/A ])
2N/A ;;
2N/A *)
2N/A gl_cv_func_printf_infinite_long_double="irrelevant"
2N/A ;;
2N/A esac
2N/A])
2N/A
2N/Adnl Test whether the *printf family of functions supports the 'a' and 'A'
2N/Adnl conversion specifier for hexadecimal output of floating-point numbers.
2N/Adnl (ISO C99, POSIX:2001)
2N/Adnl Result is gl_cv_func_printf_directive_a.
2N/A
2N/AAC_DEFUN([gl_PRINTF_DIRECTIVE_A],
2N/A[
2N/A AC_REQUIRE([AC_PROG_CC])
2N/A AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
2N/A AC_CACHE_CHECK([whether printf supports the 'a' and 'A' directives],
2N/A [gl_cv_func_printf_directive_a],
2N/A [
2N/A AC_RUN_IFELSE(
2N/A [AC_LANG_SOURCE([[
2N/A#include <stdio.h>
2N/A#include <string.h>
2N/Astatic char buf[100];
2N/Aint main ()
2N/A{
2N/A if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0
2N/A || (strcmp (buf, "0x1.922p+1 33") != 0
2N/A && strcmp (buf, "0x3.244p+0 33") != 0
2N/A && strcmp (buf, "0x6.488p-1 33") != 0
2N/A && strcmp (buf, "0xc.91p-2 33") != 0))
2N/A return 1;
2N/A if (sprintf (buf, "%A %d", -3.1416015625, 33, 44, 55) < 0
2N/A || (strcmp (buf, "-0X1.922P+1 33") != 0
2N/A && strcmp (buf, "-0X3.244P+0 33") != 0
2N/A && strcmp (buf, "-0X6.488P-1 33") != 0
2N/A && strcmp (buf, "-0XC.91P-2 33") != 0))
2N/A return 1;
2N/A /* This catches a FreeBSD 6.1 bug: it doesn't round. */
2N/A if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0
2N/A || (strcmp (buf, "0x1.83p+0 33") != 0
2N/A && strcmp (buf, "0x3.05p-1 33") != 0
2N/A && strcmp (buf, "0x6.0ap-2 33") != 0
2N/A && strcmp (buf, "0xc.14p-3 33") != 0))
2N/A return 1;
2N/A /* This catches a FreeBSD 6.1 bug. See
2N/A <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html> */
2N/A if (sprintf (buf, "%010a %d", 1.0 / 0.0, 33, 44, 55) < 0
2N/A || buf[0] == '0')
2N/A return 1;
2N/A /* This catches a MacOS X 10.3.9 (Darwin 7.9) bug. */
2N/A if (sprintf (buf, "%.1a", 1.999) < 0
2N/A || (strcmp (buf, "0x1.0p+1") != 0
2N/A && strcmp (buf, "0x2.0p+0") != 0
2N/A && strcmp (buf, "0x4.0p-1") != 0
2N/A && strcmp (buf, "0x8.0p-2") != 0))
2N/A return 1;
2N/A /* This catches the same MacOS X 10.3.9 (Darwin 7.9) bug and also a
2N/A glibc 2.4 bug <http://sourceware.org/bugzilla/show_bug.cgi?id=2908>. */
2N/A if (sprintf (buf, "%.1La", 1.999L) < 0
2N/A || (strcmp (buf, "0x1.0p+1") != 0
2N/A && strcmp (buf, "0x2.0p+0") != 0
2N/A && strcmp (buf, "0x4.0p-1") != 0
2N/A && strcmp (buf, "0x8.0p-2") != 0))
2N/A return 1;
2N/A return 0;
2N/A}]])],
2N/A [gl_cv_func_printf_directive_a=yes],
2N/A [gl_cv_func_printf_directive_a=no],
2N/A [
2N/A case "$host_os" in
2N/A # Guess yes on glibc >= 2.5 systems.
2N/A *-gnu*)
2N/A AC_EGREP_CPP([BZ2908], [
2N/A #include <features.h>
2N/A #ifdef __GNU_LIBRARY__
2N/A #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)
2N/A BZ2908
2N/A #endif
2N/A #endif
2N/A ],
2N/A [gl_cv_func_printf_directive_a="guessing yes"],
2N/A [gl_cv_func_printf_directive_a="guessing no"])
2N/A ;;
2N/A # If we don't know, assume the worst.
2N/A *) gl_cv_func_printf_directive_a="guessing no";;
2N/A esac
2N/A ])
2N/A ])
2N/A])
2N/A
2N/Adnl Test whether the *printf family of functions supports the %F format
2N/Adnl directive. (ISO C99, POSIX:2001)
2N/Adnl Result is gl_cv_func_printf_directive_f.
2N/A
2N/AAC_DEFUN([gl_PRINTF_DIRECTIVE_F],
2N/A[
2N/A AC_REQUIRE([AC_PROG_CC])
2N/A AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
2N/A AC_CACHE_CHECK([whether printf supports the 'F' directive],
2N/A [gl_cv_func_printf_directive_f],
2N/A [
2N/A AC_RUN_IFELSE(
2N/A [AC_LANG_SOURCE([[
2N/A#include <stdio.h>
2N/A#include <string.h>
2N/Astatic char buf[100];
2N/Aint main ()
2N/A{
2N/A if (sprintf (buf, "%F %d", 1234567.0, 33, 44, 55) < 0
2N/A || strcmp (buf, "1234567.000000 33") != 0)
2N/A return 1;
2N/A if (sprintf (buf, "%F", 1.0 / 0.0) < 0
2N/A || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0))
2N/A return 1;
2N/A /* This catches a Cygwin 1.5.x bug. */
2N/A if (sprintf (buf, "%.F", 1234.0) < 0
2N/A || strcmp (buf, "1234") != 0)
2N/A return 1;
2N/A return 0;
2N/A}]])],
2N/A [gl_cv_func_printf_directive_f=yes],
2N/A [gl_cv_func_printf_directive_f=no],
2N/A [
2N/Achangequote(,)dnl
2N/A case "$host_os" in
2N/A # Guess yes on glibc systems.
2N/A *-gnu*) gl_cv_func_printf_directive_f="guessing yes";;
2N/A # Guess yes on FreeBSD >= 6.
2N/A freebsd[1-5]*) gl_cv_func_printf_directive_f="guessing no";;
2N/A freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";;
2N/A # Guess yes on MacOS X >= 10.3.
2N/A darwin[1-6].*) gl_cv_func_printf_directive_f="guessing no";;
2N/A darwin*) gl_cv_func_printf_directive_f="guessing yes";;
2N/A # Guess yes on Solaris >= 2.10.
2N/A solaris2.[0-9]*) gl_cv_func_printf_directive_f="guessing no";;
2N/A solaris*) gl_cv_func_printf_directive_f="guessing yes";;
2N/A # If we don't know, assume the worst.
2N/A *) gl_cv_func_printf_directive_f="guessing no";;
2N/A esac
2N/Achangequote([,])dnl
2N/A ])
2N/A ])
2N/A])
2N/A
2N/Adnl Test whether the *printf family of functions supports the %n format
2N/Adnl directive. (ISO C99, POSIX:2001)
2N/Adnl Result is gl_cv_func_printf_directive_n.
2N/A
2N/AAC_DEFUN([gl_PRINTF_DIRECTIVE_N],
2N/A[
2N/A AC_REQUIRE([AC_PROG_CC])
2N/A AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
2N/A AC_CACHE_CHECK([whether printf supports the 'n' directive],
2N/A [gl_cv_func_printf_directive_n],
2N/A [
2N/A AC_RUN_IFELSE(
2N/A [AC_LANG_SOURCE([[
2N/A#include <stdio.h>
2N/A#include <string.h>
2N/Astatic char fmtstring[10];
2N/Astatic char buf[100];
2N/Aint main ()
2N/A{
2N/A int count = -1;
2N/A /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2)
2N/A support %n in format strings in read-only memory but not in writable
2N/A memory. */
2N/A strcpy (fmtstring, "%d %n");
2N/A if (sprintf (buf, fmtstring, 123, &count, 33, 44, 55) < 0
2N/A || strcmp (buf, "123 ") != 0
2N/A || count != 4)
2N/A return 1;
2N/A return 0;
2N/A}]])],
2N/A [gl_cv_func_printf_directive_n=yes],
2N/A [gl_cv_func_printf_directive_n=no],
2N/A [
2N/Achangequote(,)dnl
2N/A case "$host_os" in
2N/A *) gl_cv_func_printf_directive_n="guessing yes";;
2N/A esac
2N/Achangequote([,])dnl
2N/A ])
2N/A ])
2N/A])
2N/A
2N/Adnl Test whether the *printf family of functions supports the %ls format
2N/Adnl directive and in particular, when a precision is specified, whether
2N/Adnl the functions stop converting the wide string argument when the number
2N/Adnl of bytes that have been produced by this conversion equals or exceeds
2N/Adnl the precision.
2N/Adnl Result is gl_cv_func_printf_directive_ls.
2N/A
2N/AAC_DEFUN([gl_PRINTF_DIRECTIVE_LS],
2N/A[
2N/A AC_REQUIRE([AC_PROG_CC])
2N/A AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
2N/A AC_CACHE_CHECK([whether printf supports the 'ls' directive],
2N/A [gl_cv_func_printf_directive_ls],
2N/A [
2N/A AC_RUN_IFELSE(
2N/A [AC_LANG_SOURCE([[
2N/A/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
2N/A <wchar.h>.
2N/A BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
2N/A included before <wchar.h>. */
2N/A#include <stddef.h>
2N/A#include <stdio.h>
2N/A#include <time.h>
2N/A#include <wchar.h>
2N/A#include <string.h>
2N/Aint main ()
2N/A{
2N/A char buf[100];
2N/A /* Test whether %ls works at all.
2N/A This test fails on OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, but not on
2N/A Cygwin 1.5. */
2N/A {
2N/A static const wchar_t wstring[] = { 'a', 'b', 'c', 0 };
2N/A buf[0] = '\0';
2N/A if (sprintf (buf, "%ls", wstring) < 0
2N/A || strcmp (buf, "abc") != 0)
2N/A return 1;
2N/A }
2N/A /* This test fails on IRIX 6.5, Solaris 2.6, Cygwin 1.5, Haiku (with an
2N/A assertion failure inside libc), but not on OpenBSD 4.0. */
2N/A {
2N/A static const wchar_t wstring[] = { 'a', 0 };
2N/A buf[0] = '\0';
2N/A if (sprintf (buf, "%ls", wstring) < 0
2N/A || strcmp (buf, "a") != 0)
2N/A return 1;
2N/A }
2N/A /* Test whether precisions in %ls are supported as specified in ISO C 99
2N/A section 7.19.6.1:
2N/A "If a precision is specified, no more than that many bytes are written
2N/A (including shift sequences, if any), and the array shall contain a
2N/A null wide character if, to equal the multibyte character sequence
2N/A length given by the precision, the function would need to access a
2N/A wide character one past the end of the array."
2N/A This test fails on Solaris 10. */
2N/A {
2N/A static const wchar_t wstring[] = { 'a', 'b', (wchar_t) 0xfdfdfdfd, 0 };
2N/A buf[0] = '\0';
2N/A if (sprintf (buf, "%.2ls", wstring) < 0
2N/A || strcmp (buf, "ab") != 0)
2N/A return 1;
2N/A }
2N/A return 0;
2N/A}]])],
2N/A [gl_cv_func_printf_directive_ls=yes],
2N/A [gl_cv_func_printf_directive_ls=no],
2N/A [
2N/Achangequote(,)dnl
2N/A case "$host_os" in
2N/A openbsd*) gl_cv_func_printf_directive_ls="guessing no";;
2N/A irix*) gl_cv_func_printf_directive_ls="guessing no";;
2N/A solaris*) gl_cv_func_printf_directive_ls="guessing no";;
2N/A cygwin*) gl_cv_func_printf_directive_ls="guessing no";;
2N/A beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";;
2N/A *) gl_cv_func_printf_directive_ls="guessing yes";;
2N/A esac
2N/Achangequote([,])dnl
2N/A ])
2N/A ])
2N/A])
2N/A
2N/Adnl Test whether the *printf family of functions supports POSIX/XSI format
2N/Adnl strings with positions. (POSIX:2001)
2N/Adnl Result is gl_cv_func_printf_positions.
2N/A
2N/AAC_DEFUN([gl_PRINTF_POSITIONS],
2N/A[
2N/A AC_REQUIRE([AC_PROG_CC])
2N/A AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
2N/A AC_CACHE_CHECK([whether printf supports POSIX/XSI format strings with positions],
2N/A [gl_cv_func_printf_positions],
2N/A [
2N/A AC_RUN_IFELSE(
2N/A [AC_LANG_SOURCE([[
2N/A#include <stdio.h>
2N/A#include <string.h>
2N/A/* The string "%2$d %1$d", with dollar characters protected from the shell's
2N/A dollar expansion (possibly an autoconf bug). */
2N/Astatic char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
2N/Astatic char buf[100];
2N/Aint main ()
2N/A{
2N/A sprintf (buf, format, 33, 55);
2N/A return (strcmp (buf, "55 33") != 0);
2N/A}]])],
2N/A [gl_cv_func_printf_positions=yes],
2N/A [gl_cv_func_printf_positions=no],
2N/A [
2N/Achangequote(,)dnl
2N/A case "$host_os" in
2N/A netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*)
2N/A gl_cv_func_printf_positions="guessing no";;
2N/A beos*) gl_cv_func_printf_positions="guessing no";;
2N/A mingw* | pw*) gl_cv_func_printf_positions="guessing no";;
2N/A *) gl_cv_func_printf_positions="guessing yes";;
2N/A esac
2N/Achangequote([,])dnl
2N/A ])
2N/A ])
2N/A])
2N/A
2N/Adnl Test whether the *printf family of functions supports POSIX/XSI format
2N/Adnl strings with the ' flag for grouping of decimal digits. (POSIX:2001)
2N/Adnl Result is gl_cv_func_printf_flag_grouping.
2N/A
2N/AAC_DEFUN([gl_PRINTF_FLAG_GROUPING],
2N/A[
2N/A AC_REQUIRE([AC_PROG_CC])
2N/A AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
2N/A AC_CACHE_CHECK([whether printf supports the grouping flag],
2N/A [gl_cv_func_printf_flag_grouping],
2N/A [
2N/A AC_RUN_IFELSE(
2N/A [AC_LANG_SOURCE([[
2N/A#include <stdio.h>
2N/A#include <string.h>
2N/Astatic char buf[100];
2N/Aint main ()
2N/A{
2N/A if (sprintf (buf, "%'d %d", 1234567, 99) < 0
2N/A || buf[strlen (buf) - 1] != '9')
2N/A return 1;
2N/A return 0;
2N/A}]])],
2N/A [gl_cv_func_printf_flag_grouping=yes],
2N/A [gl_cv_func_printf_flag_grouping=no],
2N/A [
2N/Achangequote(,)dnl
2N/A case "$host_os" in
2N/A cygwin*) gl_cv_func_printf_flag_grouping="guessing no";;
2N/A netbsd*) gl_cv_func_printf_flag_grouping="guessing no";;
2N/A mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";;
2N/A *) gl_cv_func_printf_flag_grouping="guessing yes";;
2N/A esac
2N/Achangequote([,])dnl
2N/A ])
2N/A ])
2N/A])
2N/A
2N/Adnl Test whether the *printf family of functions supports the - flag correctly.
2N/Adnl (ISO C99.) See
2N/Adnl <http://lists.gnu.org/archive/html/bug-coreutils/2008-02/msg00035.html>
2N/Adnl Result is gl_cv_func_printf_flag_leftadjust.
2N/A
2N/AAC_DEFUN([gl_PRINTF_FLAG_LEFTADJUST],
2N/A[
2N/A AC_REQUIRE([AC_PROG_CC])
2N/A AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
2N/A AC_CACHE_CHECK([whether printf supports the left-adjust flag correctly],
2N/A [gl_cv_func_printf_flag_leftadjust],
2N/A [
2N/A AC_RUN_IFELSE(
2N/A [AC_LANG_SOURCE([[
2N/A#include <stdio.h>
2N/A#include <string.h>
2N/Astatic char buf[100];
2N/Aint main ()
2N/A{
2N/A /* Check that a '-' flag is not annihilated by a negative width. */
2N/A if (sprintf (buf, "a%-*sc", -3, "b") < 0
2N/A || strcmp (buf, "ab c") != 0)
2N/A return 1;
2N/A return 0;
2N/A}]])],
2N/A [gl_cv_func_printf_flag_leftadjust=yes],
2N/A [gl_cv_func_printf_flag_leftadjust=no],
2N/A [
2N/Achangequote(,)dnl
2N/A case "$host_os" in
2N/A # Guess yes on HP-UX 11.
2N/A hpux11*) gl_cv_func_printf_flag_leftadjust="guessing yes";;
2N/A # Guess no on HP-UX 10 and older.
2N/A hpux*) gl_cv_func_printf_flag_leftadjust="guessing no";;
2N/A # Guess yes otherwise.
2N/A *) gl_cv_func_printf_flag_leftadjust="guessing yes";;
2N/A esac
2N/Achangequote([,])dnl
2N/A ])
2N/A ])
2N/A])
2N/A
2N/Adnl Test whether the *printf family of functions supports padding of non-finite
2N/Adnl values with the 0 flag correctly. (ISO C99 + TC1 + TC2.) See
2N/Adnl <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html>
2N/Adnl Result is gl_cv_func_printf_flag_zero.
2N/A
2N/AAC_DEFUN([gl_PRINTF_FLAG_ZERO],
2N/A[
2N/A AC_REQUIRE([AC_PROG_CC])
2N/A AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
2N/A AC_CACHE_CHECK([whether printf supports the zero flag correctly],
2N/A [gl_cv_func_printf_flag_zero],
2N/A [
2N/A AC_RUN_IFELSE(
2N/A [AC_LANG_SOURCE([[
2N/A#include <stdio.h>
2N/A#include <string.h>
2N/Astatic char buf[100];
2N/Aint main ()
2N/A{
2N/A if (sprintf (buf, "%010f", 1.0 / 0.0, 33, 44, 55) < 0
2N/A || (strcmp (buf, " inf") != 0
2N/A && strcmp (buf, " infinity") != 0))
2N/A return 1;
2N/A return 0;
2N/A}]])],
2N/A [gl_cv_func_printf_flag_zero=yes],
2N/A [gl_cv_func_printf_flag_zero=no],
2N/A [
2N/Achangequote(,)dnl
2N/A case "$host_os" in
2N/A # Guess yes on glibc systems.
2N/A *-gnu*) gl_cv_func_printf_flag_zero="guessing yes";;
2N/A # Guess yes on BeOS.
2N/A beos*) gl_cv_func_printf_flag_zero="guessing yes";;
2N/A # If we don't know, assume the worst.
2N/A *) gl_cv_func_printf_flag_zero="guessing no";;
2N/A esac
2N/Achangequote([,])dnl
2N/A ])
2N/A ])
2N/A])
2N/A
2N/Adnl Test whether the *printf family of functions supports large precisions.
2N/Adnl On mingw, precisions larger than 512 are treated like 512, in integer,
2N/Adnl floating-point or pointer output. On BeOS, precisions larger than 1044
2N/Adnl crash the program.
2N/Adnl Result is gl_cv_func_printf_precision.
2N/A
2N/AAC_DEFUN([gl_PRINTF_PRECISION],
2N/A[
2N/A AC_REQUIRE([AC_PROG_CC])
2N/A AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
2N/A AC_CACHE_CHECK([whether printf supports large precisions],
2N/A [gl_cv_func_printf_precision],
2N/A [
2N/A AC_RUN_IFELSE(
2N/A [AC_LANG_SOURCE([[
2N/A#include <stdio.h>
2N/A#include <string.h>
2N/Astatic char buf[5000];
2N/Aint main ()
2N/A{
2N/A#ifdef __BEOS__
2N/A /* On BeOS, this would crash and show a dialog box. Avoid the crash. */
2N/A return 1;
2N/A#endif
2N/A if (sprintf (buf, "%.4000d %d", 1, 33, 44) < 4000 + 3)
2N/A return 1;
2N/A return 0;
2N/A}]])],
2N/A [gl_cv_func_printf_precision=yes],
2N/A [gl_cv_func_printf_precision=no],
2N/A [
2N/Achangequote(,)dnl
2N/A case "$host_os" in
2N/A # Guess no only on native Win32 and BeOS systems.
2N/A mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;;
2N/A beos*) gl_cv_func_printf_precision="guessing no" ;;
2N/A *) gl_cv_func_printf_precision="guessing yes" ;;
2N/A esac
2N/Achangequote([,])dnl
2N/A ])
2N/A ])
2N/A])
2N/A
2N/Adnl Test whether the *printf family of functions recovers gracefully in case
2N/Adnl of an out-of-memory condition, or whether it crashes the entire program.
2N/Adnl Result is gl_cv_func_printf_enomem.
2N/A
2N/AAC_DEFUN([gl_PRINTF_ENOMEM],
2N/A[
2N/A AC_REQUIRE([AC_PROG_CC])
2N/A AC_REQUIRE([gl_MULTIARCH])
2N/A AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
2N/A AC_CACHE_CHECK([whether printf survives out-of-memory conditions],
2N/A [gl_cv_func_printf_enomem],
2N/A [
2N/A gl_cv_func_printf_enomem="guessing no"
2N/A if test "$cross_compiling" = no; then
2N/A if test $APPLE_UNIVERSAL_BUILD = 0; then
2N/A AC_LANG_CONFTEST([AC_LANG_SOURCE([
2N/A]GL_NOCRASH[
2N/Achangequote(,)dnl
2N/A#include <stdio.h>
2N/A#include <sys/types.h>
2N/A#include <sys/time.h>
2N/A#include <sys/resource.h>
2N/A#include <errno.h>
2N/Aint main()
2N/A{
2N/A struct rlimit limit;
2N/A int ret;
2N/A nocrash_init ();
2N/A /* Some printf implementations allocate temporary space with malloc. */
2N/A /* On BSD systems, malloc() is limited by RLIMIT_DATA. */
2N/A#ifdef RLIMIT_DATA
2N/A if (getrlimit (RLIMIT_DATA, &limit) < 0)
2N/A return 77;
2N/A if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
2N/A limit.rlim_max = 5000000;
2N/A limit.rlim_cur = limit.rlim_max;
2N/A if (setrlimit (RLIMIT_DATA, &limit) < 0)
2N/A return 77;
2N/A#endif
2N/A /* On Linux systems, malloc() is limited by RLIMIT_AS. */
2N/A#ifdef RLIMIT_AS
2N/A if (getrlimit (RLIMIT_AS, &limit) < 0)
2N/A return 77;
2N/A if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
2N/A limit.rlim_max = 5000000;
2N/A limit.rlim_cur = limit.rlim_max;
2N/A if (setrlimit (RLIMIT_AS, &limit) < 0)
2N/A return 77;
2N/A#endif
2N/A /* Some printf implementations allocate temporary space on the stack. */
2N/A#ifdef RLIMIT_STACK
2N/A if (getrlimit (RLIMIT_STACK, &limit) < 0)
2N/A return 77;
2N/A if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
2N/A limit.rlim_max = 5000000;
2N/A limit.rlim_cur = limit.rlim_max;
2N/A if (setrlimit (RLIMIT_STACK, &limit) < 0)
2N/A return 77;
2N/A#endif
2N/A ret = printf ("%.5000000f", 1.0);
2N/A return !(ret == 5000002 || (ret < 0 && errno == ENOMEM));
2N/A}
2N/Achangequote([,])dnl
2N/A ])])
2N/A if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
2N/A (./conftest
2N/A result=$?
2N/A if test $result != 0 && test $result != 77; then result=1; fi
2N/A exit $result
2N/A ) >/dev/null 2>/dev/null
2N/A case $? in
2N/A 0) gl_cv_func_printf_enomem="yes" ;;
2N/A 77) gl_cv_func_printf_enomem="guessing no" ;;
2N/A *) gl_cv_func_printf_enomem="no" ;;
2N/A esac
2N/A else
2N/A gl_cv_func_printf_enomem="guessing no"
2N/A fi
2N/A rm -fr conftest*
2N/A else
2N/A dnl A universal build on Apple MacOS X platforms.
2N/A dnl The result would be 'no' in 32-bit mode and 'yes' in 64-bit mode.
2N/A dnl But we need a configuration result that is valid in both modes.
2N/A gl_cv_func_printf_enomem="guessing no"
2N/A fi
2N/A fi
2N/A if test "$gl_cv_func_printf_enomem" = "guessing no"; then
2N/Achangequote(,)dnl
2N/A case "$host_os" in
2N/A # Guess yes on glibc systems.
2N/A *-gnu*) gl_cv_func_printf_enomem="guessing yes";;
2N/A # Guess yes on Solaris.
2N/A solaris*) gl_cv_func_printf_enomem="guessing yes";;
2N/A # Guess yes on AIX.
2N/A aix*) gl_cv_func_printf_enomem="guessing yes";;
2N/A # Guess yes on HP-UX/hppa.
2N/A hpux*) case "$host_cpu" in
2N/A hppa*) gl_cv_func_printf_enomem="guessing yes";;
2N/A *) gl_cv_func_printf_enomem="guessing no";;
2N/A esac
2N/A ;;
2N/A # Guess yes on IRIX.
2N/A irix*) gl_cv_func_printf_enomem="guessing yes";;
2N/A # Guess yes on OSF/1.
2N/A osf*) gl_cv_func_printf_enomem="guessing yes";;
2N/A # Guess yes on BeOS.
2N/A beos*) gl_cv_func_printf_enomem="guessing yes";;
2N/A # Guess yes on Haiku.
2N/A haiku*) gl_cv_func_printf_enomem="guessing yes";;
2N/A # If we don't know, assume the worst.
2N/A *) gl_cv_func_printf_enomem="guessing no";;
2N/A esac
2N/Achangequote([,])dnl
2N/A fi
2N/A ])
2N/A])
2N/A
2N/Adnl Test whether the snprintf function exists. (ISO C99, POSIX:2001)
2N/Adnl Result is ac_cv_func_snprintf.
2N/A
2N/AAC_DEFUN([gl_SNPRINTF_PRESENCE],
2N/A[
2N/A AC_CHECK_FUNCS_ONCE([snprintf])
2N/A])
2N/A
2N/Adnl Test whether the string produced by the snprintf function is always NUL
2N/Adnl terminated. (ISO C99, POSIX:2001)
2N/Adnl Result is gl_cv_func_snprintf_truncation_c99.
2N/A
2N/AAC_DEFUN([gl_SNPRINTF_TRUNCATION_C99],
2N/A[
2N/A AC_REQUIRE([AC_PROG_CC])
2N/A AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
2N/A AC_CACHE_CHECK([whether snprintf truncates the result as in C99],
2N/A [gl_cv_func_snprintf_truncation_c99],
2N/A [
2N/A AC_RUN_IFELSE(
2N/A [AC_LANG_SOURCE([[
2N/A#include <stdio.h>
2N/A#include <string.h>
2N/Astatic char buf[100];
2N/Aint main ()
2N/A{
2N/A strcpy (buf, "ABCDEF");
2N/A snprintf (buf, 3, "%d %d", 4567, 89);
2N/A if (memcmp (buf, "45\0DEF", 6) != 0)
2N/A return 1;
2N/A return 0;
2N/A}]])],
2N/A [gl_cv_func_snprintf_truncation_c99=yes],
2N/A [gl_cv_func_snprintf_truncation_c99=no],
2N/A [
2N/Achangequote(,)dnl
2N/A case "$host_os" in
2N/A # Guess yes on glibc systems.
2N/A *-gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
2N/A # Guess yes on FreeBSD >= 5.
2N/A freebsd[1-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
2N/A freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
2N/A # Guess yes on MacOS X >= 10.3.
2N/A darwin[1-6].*) gl_cv_func_snprintf_truncation_c99="guessing no";;
2N/A darwin*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
2N/A # Guess yes on OpenBSD >= 3.9.
2N/A openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
2N/A gl_cv_func_snprintf_truncation_c99="guessing no";;
2N/A openbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
2N/A # Guess yes on Solaris >= 2.6.
2N/A solaris2.[0-5]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
2N/A solaris*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
2N/A # Guess yes on AIX >= 4.
2N/A aix[1-3]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
2N/A aix*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
2N/A # Guess yes on HP-UX >= 11.
2N/A hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";;
2N/A hpux*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
2N/A # Guess yes on IRIX >= 6.5.
2N/A irix6.5) gl_cv_func_snprintf_truncation_c99="guessing yes";;
2N/A # Guess yes on OSF/1 >= 5.
2N/A osf[3-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
2N/A osf*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
2N/A # Guess yes on NetBSD >= 3.
2N/A netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
2N/A gl_cv_func_snprintf_truncation_c99="guessing no";;
2N/A netbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
2N/A # Guess yes on BeOS.
2N/A beos*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
2N/A # If we don't know, assume the worst.
2N/A *) gl_cv_func_snprintf_truncation_c99="guessing no";;
2N/A esac
2N/Achangequote([,])dnl
2N/A ])
2N/A ])
2N/A])
2N/A
2N/Adnl Test whether the return value of the snprintf function is the number
2N/Adnl of bytes (excluding the terminating NUL) that would have been produced
2N/Adnl if the buffer had been large enough. (ISO C99, POSIX:2001)
2N/Adnl For example, this test program fails on IRIX 6.5:
2N/Adnl ---------------------------------------------------------------------
2N/Adnl #include <stdio.h>
2N/Adnl int main()
2N/Adnl {
2N/Adnl static char buf[8];
2N/Adnl int retval = snprintf (buf, 3, "%d", 12345);
2N/Adnl return retval >= 0 && retval < 3;
2N/Adnl }
2N/Adnl ---------------------------------------------------------------------
2N/Adnl Result is gl_cv_func_snprintf_retval_c99.
2N/A
2N/AAC_DEFUN_ONCE([gl_SNPRINTF_RETVAL_C99],
2N/A[
2N/A AC_REQUIRE([AC_PROG_CC])
2N/A AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
2N/A AC_CACHE_CHECK([whether snprintf returns a byte count as in C99],
2N/A [gl_cv_func_snprintf_retval_c99],
2N/A [
2N/A AC_RUN_IFELSE(
2N/A [AC_LANG_SOURCE([[
2N/A#include <stdio.h>
2N/A#include <string.h>
2N/Astatic char buf[100];
2N/Aint main ()
2N/A{
2N/A strcpy (buf, "ABCDEF");
2N/A if (snprintf (buf, 3, "%d %d", 4567, 89) != 7)
2N/A return 1;
2N/A return 0;
2N/A}]])],
2N/A [gl_cv_func_snprintf_retval_c99=yes],
2N/A [gl_cv_func_snprintf_retval_c99=no],
2N/A [
2N/Achangequote(,)dnl
2N/A case "$host_os" in
2N/A # Guess yes on glibc systems.
2N/A *-gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";;
2N/A # Guess yes on FreeBSD >= 5.
2N/A freebsd[1-4]*) gl_cv_func_snprintf_retval_c99="guessing no";;
2N/A freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
2N/A # Guess yes on MacOS X >= 10.3.
2N/A darwin[1-6].*) gl_cv_func_snprintf_retval_c99="guessing no";;
2N/A darwin*) gl_cv_func_snprintf_retval_c99="guessing yes";;
2N/A # Guess yes on OpenBSD >= 3.9.
2N/A openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
2N/A gl_cv_func_snprintf_retval_c99="guessing no";;
2N/A openbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
2N/A # Guess yes on Solaris >= 2.6.
2N/A solaris2.[0-5]*) gl_cv_func_snprintf_retval_c99="guessing no";;
2N/A solaris*) gl_cv_func_snprintf_retval_c99="guessing yes";;
2N/A # Guess yes on AIX >= 4.
2N/A aix[1-3]*) gl_cv_func_snprintf_retval_c99="guessing no";;
2N/A aix*) gl_cv_func_snprintf_retval_c99="guessing yes";;
2N/A # Guess yes on NetBSD >= 3.
2N/A netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
2N/A gl_cv_func_snprintf_retval_c99="guessing no";;
2N/A netbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
2N/A # Guess yes on BeOS.
2N/A beos*) gl_cv_func_snprintf_retval_c99="guessing yes";;
2N/A # If we don't know, assume the worst.
2N/A *) gl_cv_func_snprintf_retval_c99="guessing no";;
2N/A esac
2N/Achangequote([,])dnl
2N/A ])
2N/A ])
2N/A])
2N/A
2N/Adnl Test whether the snprintf function supports the %n format directive
2N/Adnl also in truncated portions of the format string. (ISO C99, POSIX:2001)
2N/Adnl Result is gl_cv_func_snprintf_directive_n.
2N/A
2N/AAC_DEFUN([gl_SNPRINTF_DIRECTIVE_N],
2N/A[
2N/A AC_REQUIRE([AC_PROG_CC])
2N/A AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
2N/A AC_CACHE_CHECK([whether snprintf fully supports the 'n' directive],
2N/A [gl_cv_func_snprintf_directive_n],
2N/A [
2N/A AC_RUN_IFELSE(
2N/A [AC_LANG_SOURCE([[
2N/A#include <stdio.h>
2N/A#include <string.h>
2N/Astatic char fmtstring[10];
2N/Astatic char buf[100];
2N/Aint main ()
2N/A{
2N/A int count = -1;
2N/A /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2)
2N/A support %n in format strings in read-only memory but not in writable
2N/A memory. */
2N/A strcpy (fmtstring, "%d %n");
2N/A snprintf (buf, 4, fmtstring, 12345, &count, 33, 44, 55);
2N/A if (count != 6)
2N/A return 1;
2N/A return 0;
2N/A}]])],
2N/A [gl_cv_func_snprintf_directive_n=yes],
2N/A [gl_cv_func_snprintf_directive_n=no],
2N/A [
2N/Achangequote(,)dnl
2N/A case "$host_os" in
2N/A # Guess yes on glibc systems.
2N/A *-gnu*) gl_cv_func_snprintf_directive_n="guessing yes";;
2N/A # Guess yes on FreeBSD >= 5.
2N/A freebsd[1-4]*) gl_cv_func_snprintf_directive_n="guessing no";;
2N/A freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
2N/A # Guess yes on MacOS X >= 10.3.
2N/A darwin[1-6].*) gl_cv_func_snprintf_directive_n="guessing no";;
2N/A darwin*) gl_cv_func_snprintf_directive_n="guessing yes";;
2N/A # Guess yes on Solaris >= 2.6.
2N/A solaris2.[0-5]*) gl_cv_func_snprintf_directive_n="guessing no";;
2N/A solaris*) gl_cv_func_snprintf_directive_n="guessing yes";;
2N/A # Guess yes on AIX >= 4.
2N/A aix[1-3]*) gl_cv_func_snprintf_directive_n="guessing no";;
2N/A aix*) gl_cv_func_snprintf_directive_n="guessing yes";;
2N/A # Guess yes on IRIX >= 6.5.
2N/A irix6.5) gl_cv_func_snprintf_directive_n="guessing yes";;
2N/A # Guess yes on OSF/1 >= 5.
2N/A osf[3-4]*) gl_cv_func_snprintf_directive_n="guessing no";;
2N/A osf*) gl_cv_func_snprintf_directive_n="guessing yes";;
2N/A # Guess yes on NetBSD >= 3.
2N/A netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
2N/A gl_cv_func_snprintf_directive_n="guessing no";;
2N/A netbsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
2N/A # Guess yes on BeOS.
2N/A beos*) gl_cv_func_snprintf_directive_n="guessing yes";;
2N/A # If we don't know, assume the worst.
2N/A *) gl_cv_func_snprintf_directive_n="guessing no";;
2N/A esac
2N/Achangequote([,])dnl
2N/A ])
2N/A ])
2N/A])
2N/A
2N/Adnl Test whether the snprintf function, when passed a size = 1, writes any
2N/Adnl output without bounds in this case, behaving like sprintf. This is the
2N/Adnl case on Linux libc5.
2N/Adnl Result is gl_cv_func_snprintf_size1.
2N/A
2N/AAC_DEFUN([gl_SNPRINTF_SIZE1],
2N/A[
2N/A AC_REQUIRE([AC_PROG_CC])
2N/A AC_CACHE_CHECK([whether snprintf respects a size of 1],
2N/A [gl_cv_func_snprintf_size1],
2N/A [
2N/A AC_RUN_IFELSE(
2N/A [AC_LANG_SOURCE([[
2N/A#include <stdio.h>
2N/Aint main()
2N/A{
2N/A static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
2N/A snprintf (buf, 1, "%d", 12345);
2N/A return buf[1] != 'E';
2N/A}]])],
2N/A [gl_cv_func_snprintf_size1=yes],
2N/A [gl_cv_func_snprintf_size1=no],
2N/A [gl_cv_func_snprintf_size1="guessing yes"])
2N/A ])
2N/A])
2N/A
2N/Adnl Test whether the vsnprintf function, when passed a zero size, produces no
2N/Adnl output. (ISO C99, POSIX:2001)
2N/Adnl For example, snprintf nevertheless writes a NUL byte in this case
2N/Adnl on OSF/1 5.1:
2N/Adnl ---------------------------------------------------------------------
2N/Adnl #include <stdio.h>
2N/Adnl int main()
2N/Adnl {
2N/Adnl static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
2N/Adnl snprintf (buf, 0, "%d", 12345);
2N/Adnl return buf[0] != 'D';
2N/Adnl }
2N/Adnl ---------------------------------------------------------------------
2N/Adnl And vsnprintf writes any output without bounds in this case, behaving like
2N/Adnl vsprintf, on HP-UX 11 and OSF/1 5.1:
2N/Adnl ---------------------------------------------------------------------
2N/Adnl #include <stdarg.h>
2N/Adnl #include <stdio.h>
2N/Adnl static int my_snprintf (char *buf, int size, const char *format, ...)
2N/Adnl {
2N/Adnl va_list args;
2N/Adnl int ret;
2N/Adnl va_start (args, format);
2N/Adnl ret = vsnprintf (buf, size, format, args);
2N/Adnl va_end (args);
2N/Adnl return ret;
2N/Adnl }
2N/Adnl int main()
2N/Adnl {
2N/Adnl static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
2N/Adnl my_snprintf (buf, 0, "%d", 12345);
2N/Adnl return buf[0] != 'D';
2N/Adnl }
2N/Adnl ---------------------------------------------------------------------
2N/Adnl Result is gl_cv_func_vsnprintf_zerosize_c99.
2N/A
2N/AAC_DEFUN([gl_VSNPRINTF_ZEROSIZE_C99],
2N/A[
2N/A AC_REQUIRE([AC_PROG_CC])
2N/A AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
2N/A AC_CACHE_CHECK([whether vsnprintf respects a zero size as in C99],
2N/A [gl_cv_func_vsnprintf_zerosize_c99],
2N/A [
2N/A AC_RUN_IFELSE(
2N/A [AC_LANG_SOURCE([[
2N/A#include <stdarg.h>
2N/A#include <stdio.h>
2N/Astatic int my_snprintf (char *buf, int size, const char *format, ...)
2N/A{
2N/A va_list args;
2N/A int ret;
2N/A va_start (args, format);
2N/A ret = vsnprintf (buf, size, format, args);
2N/A va_end (args);
2N/A return ret;
2N/A}
2N/Aint main()
2N/A{
2N/A static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
2N/A my_snprintf (buf, 0, "%d", 12345);
2N/A return buf[0] != 'D';
2N/A}]])],
2N/A [gl_cv_func_vsnprintf_zerosize_c99=yes],
2N/A [gl_cv_func_vsnprintf_zerosize_c99=no],
2N/A [
2N/Achangequote(,)dnl
2N/A case "$host_os" in
2N/A # Guess yes on glibc systems.
2N/A *-gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
2N/A # Guess yes on FreeBSD >= 5.
2N/A freebsd[1-4]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
2N/A freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
2N/A # Guess yes on MacOS X >= 10.3.
2N/A darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
2N/A darwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
2N/A # Guess yes on Cygwin.
2N/A cygwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
2N/A # Guess yes on Solaris >= 2.6.
2N/A solaris2.[0-5]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
2N/A solaris*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
2N/A # Guess yes on AIX >= 4.
2N/A aix[1-3]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
2N/A aix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
2N/A # Guess yes on IRIX >= 6.5.
2N/A irix6.5) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
2N/A # Guess yes on NetBSD >= 3.
2N/A netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
2N/A gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
2N/A netbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
2N/A # Guess yes on BeOS.
2N/A beos*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
2N/A # Guess yes on mingw.
2N/A mingw* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
2N/A # If we don't know, assume the worst.
2N/A *) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
2N/A esac
2N/Achangequote([,])dnl
2N/A ])
2N/A ])
2N/A])
2N/A
2N/Adnl The results of these tests on various platforms are:
2N/Adnl
2N/Adnl 1 = gl_PRINTF_SIZES_C99
2N/Adnl 2 = gl_PRINTF_LONG_DOUBLE
2N/Adnl 3 = gl_PRINTF_INFINITE
2N/Adnl 4 = gl_PRINTF_INFINITE_LONG_DOUBLE
2N/Adnl 5 = gl_PRINTF_DIRECTIVE_A
2N/Adnl 6 = gl_PRINTF_DIRECTIVE_F
2N/Adnl 7 = gl_PRINTF_DIRECTIVE_N
2N/Adnl 8 = gl_PRINTF_DIRECTIVE_LS
2N/Adnl 9 = gl_PRINTF_POSITIONS
2N/Adnl 10 = gl_PRINTF_FLAG_GROUPING
2N/Adnl 11 = gl_PRINTF_FLAG_LEFTADJUST
2N/Adnl 12 = gl_PRINTF_FLAG_ZERO
2N/Adnl 13 = gl_PRINTF_PRECISION
2N/Adnl 14 = gl_PRINTF_ENOMEM
2N/Adnl 15 = gl_SNPRINTF_PRESENCE
2N/Adnl 16 = gl_SNPRINTF_TRUNCATION_C99
2N/Adnl 17 = gl_SNPRINTF_RETVAL_C99
2N/Adnl 18 = gl_SNPRINTF_DIRECTIVE_N
2N/Adnl 19 = gl_SNPRINTF_SIZE1
2N/Adnl 20 = gl_VSNPRINTF_ZEROSIZE_C99
2N/Adnl
2N/Adnl 1 = checking whether printf supports size specifiers as in C99...
2N/Adnl 2 = checking whether printf supports 'long double' arguments...
2N/Adnl 3 = checking whether printf supports infinite 'double' arguments...
2N/Adnl 4 = checking whether printf supports infinite 'long double' arguments...
2N/Adnl 5 = checking whether printf supports the 'a' and 'A' directives...
2N/Adnl 6 = checking whether printf supports the 'F' directive...
2N/Adnl 7 = checking whether printf supports the 'n' directive...
2N/Adnl 8 = checking whether printf supports the 'ls' directive...
2N/Adnl 9 = checking whether printf supports POSIX/XSI format strings with positions...
2N/Adnl 10 = checking whether printf supports the grouping flag...
2N/Adnl 11 = checking whether printf supports the left-adjust flag correctly...
2N/Adnl 12 = checking whether printf supports the zero flag correctly...
2N/Adnl 13 = checking whether printf supports large precisions...
2N/Adnl 14 = checking whether printf survives out-of-memory conditions...
2N/Adnl 15 = checking for snprintf...
2N/Adnl 16 = checking whether snprintf truncates the result as in C99...
2N/Adnl 17 = checking whether snprintf returns a byte count as in C99...
2N/Adnl 18 = checking whether snprintf fully supports the 'n' directive...
2N/Adnl 19 = checking whether snprintf respects a size of 1...
2N/Adnl 20 = checking whether vsnprintf respects a zero size as in C99...
2N/Adnl
2N/Adnl . = yes, # = no.
2N/Adnl
2N/Adnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
2N/Adnl glibc 2.5 . . . . . . . . . . . . . . . . . . . .
2N/Adnl glibc 2.3.6 . . . . # . . . . . . . . . . . . . . .
2N/Adnl FreeBSD 5.4, 6.1 . . . . # . . . . . . # . # . . . . . .
2N/Adnl MacOS X 10.3.9 . . . . # . . . . . . # . # . . . . . .
2N/Adnl OpenBSD 3.9, 4.0 . . # # # # . # . # . # . # . . . . . .
2N/Adnl Cygwin 1.7.0 (2009) . . . # . . . ? . . . . . ? . . . . . .
2N/Adnl Cygwin 1.5.25 (2008) . . . # # . . # . . . . . # . . . . . .
2N/Adnl Cygwin 1.5.19 (2006) # . . # # # . # . # . # # # . . . . . .
2N/Adnl Solaris 10 . . # # # . . # . . . # . . . . . . . .
2N/Adnl Solaris 2.6 ... 9 # . # # # # . # . . . # . . . . . . . .
2N/Adnl Solaris 2.5.1 # . # # # # . # . . . # . . # # # # # #
2N/Adnl AIX 5.2, 7.1 . . # # # . . . . . . # . . . . . . . .
2N/Adnl AIX 4.3.2, 5.1 # . # # # # . . . . . # . . . . . . . .
2N/Adnl HP-UX 11.31 . . . . # . . . . . . # . . . . # # . .
2N/Adnl HP-UX 11.{00,11,23} # . . . # # . . . . . # . . . . # # . #
2N/Adnl HP-UX 10.20 # . # . # # . ? . . # # . . . . # # ? #
2N/Adnl IRIX 6.5 # . # # # # . # . . . # . . . . # . . .
2N/Adnl OSF/1 5.1 # . # # # # . . . . . # . . . . # . . #
2N/Adnl OSF/1 4.0d # . # # # # . . . . . # . . # # # # # #
2N/Adnl NetBSD 4.0 . ? ? ? ? ? . ? . ? ? ? ? ? . . . ? ? ?
2N/Adnl NetBSD 3.0 . . . . # # . ? # # ? # . # . . . . . .
2N/Adnl Haiku . . . # # # . # . . . . . ? . . . . . .
2N/Adnl BeOS # # . # # # . ? # . ? . # ? . . . . . .
2N/Adnl mingw # # # # # # . . # # . # # ? . # # # . .