sprintf-posix: Fix test failure on AIX 7.1.
[gnulib.git] / doc / posix-functions / snprintf.texi
1 @node snprintf
2 @section @code{snprintf}
3 @findex snprintf
4
5 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/snprintf.html}
6
7 Gnulib module: snprintf or snprintf-posix
8
9 Portability problems fixed by either Gnulib module @code{snprintf} or @code{snprintf-posix}:
10 @itemize
11 @item
12 This function is missing on some platforms:
13 IRIX 5.3, OSF/1 4.0, Solaris 2.5.1.
14 @item
15 This function does not return a byte count as specified in C99 on some platforms:
16 HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 9, mingw.
17 @item
18 This function overwrites memory even when a size argument of 1 is passed on some
19 platforms:
20 Linux libc5.
21 @end itemize
22
23 Portability problems fixed by Gnulib module @code{snprintf-posix}:
24 @itemize
25 @item
26 This function does not support size specifiers as in C99 (@code{hh}, @code{ll},
27 @code{j}, @code{t}, @code{z}) on some platforms:
28 AIX 5.1, HP-UX 11.23, IRIX 6.5, OSF/1 5.1, Solaris 9, Cygwin 1.5.24, mingw, BeOS.
29 @item
30 printf of @samp{long double} numbers is unsupported on some platforms:
31 mingw, BeOS.
32 @item
33 printf @code{"%f"}, @code{"%e"}, @code{"%g"} of Infinity and NaN yields an
34 incorrect result on some platforms:
35 AIX 5.2, OSF/1 5.1, Solaris 11 2010-11, mingw.
36 @item
37 This function does not support the @samp{a} and @samp{A} directives on some
38 platforms:
39 glibc-2.3.6, MacOS X 10.5, NetBSD 5.0, OpenBSD 4.0, AIX 5.2, HP-UX 11,
40 IRIX 6.5, OSF/1 5.1, Solaris 11 2010-11, Cygwin 1.5.x, mingw, BeOS.
41 @item
42 This function does not support the @samp{F} directive on some platforms:
43 NetBSD 3.0, AIX 5.1, HP-UX 11.23, IRIX 6.5, OSF/1 5.1, Solaris 9,
44 Cygwin 1.5.x, mingw, BeOS.
45 @item
46 This function does not support the @samp{ls} directive on some platforms:
47 OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Cygwin 1.5.x, Haiku.
48 @item
49 This function does not support precisions in the @samp{ls} directive correctly
50 on some platforms:
51 Solaris 11 2010-11.
52 @item
53 This function does not support format directives that access arguments in an
54 arbitrary order, such as @code{"%2$s"}, on some platforms:
55 NetBSD 3.0, mingw, BeOS.
56 @item
57 This function doesn't support the @code{'} flag on some platforms:
58 NetBSD 3.0, Cygwin 1.5.24, mingw.
59 @item
60 This function behaves incorrectly when a @samp{-} flag and a negative width
61 are specified together, on some platforms:
62 HP-UX 10.20.
63 @item
64 printf @code{"%010f"} of NaN and Infinity yields an incorrect result (padded
65 with zeroes) on some platforms:
66 MacOS X 10.5, FreeBSD 6.0, NetBSD 5.0, AIX 5.2, IRIX 6.5, OSF/1 5.1, Solaris 11 2010-11, Cygwin 1.5.x, mingw.
67 @item
68 This function does not support precisions larger than 512 or 1024 in integer,
69 floating-point and pointer output on some platforms:
70 AIX 7.1, Solaris 10/x86, mingw, BeOS.
71 @item
72 This function mishandles large floating point precisions
73 (for example, formatting 1.0 with @samp{"%.511f"})
74 on some platforms:
75 Solaris 10.
76 @item
77 This function can crash in out-of-memory conditions on some platforms:
78 MacOS X 10.3, FreeBSD 6.0, NetBSD 5.0.
79 @item
80 This function does not truncate the result as specified in C99 on some platforms:
81 mingw.
82 @item
83 This function does not fully support the @samp{n} directive on some platforms:
84 HP-UX 11, mingw.
85 @item
86 This function overwrites memory when a size = 1 argument is passed on some
87 platforms:
88 BeOS.
89 @item
90 This function overwrites memory even when a zero size argument is passed on some
91 platforms:
92 OSF/1 5.1.
93 @end itemize
94
95 Portability problems not fixed by Gnulib:
96 @itemize
97 @end itemize