* libc/stdio/sprintf.c: Document 'm' conversion specifier.

* libc/stdio/swprintf.c: Ditto.
	* libc/stdio/vfprintf.c (_VFPRINTF_R) [_GLIBC_EXTENSION]: Handle 'm'
	conversion specifier.
	* libc/stdio/vfwprintf.c (_VFWPRINTF_R) [_GLIBC_EXTENSION]: Ditto.
This commit is contained in:
Yaakov Selkowitz 2012-01-13 09:13:57 +00:00
parent b2af74282b
commit 29d84e5a46
5 changed files with 43 additions and 3 deletions

View File

@ -1,3 +1,11 @@
2012-01-13 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
* libc/stdio/sprintf.c: Document 'm' conversion specifier.
* libc/stdio/swprintf.c: Ditto.
* libc/stdio/vfprintf.c (_VFPRINTF_R) [_GLIBC_EXTENSION]: Handle 'm'
conversion specifier.
* libc/stdio/vfwprintf.c (_VFWPRINTF_R) [_GLIBC_EXTENSION]: Ditto.
2012-01-12 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> 2012-01-12 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
* libc/include/tgmath.h: New header. * libc/include/tgmath.h: New header.

View File

@ -518,6 +518,10 @@ DESCRIPTION
implementation is similar to <<%#tx>>), except implementation is similar to <<%#tx>>), except
that <<0x>> appears even for the NULL pointer. that <<0x>> appears even for the NULL pointer.
o m
Prints the output of <<strerror(errno)>>; no
argument is required. A GNU extension.
o- o-
O- O-

View File

@ -498,6 +498,10 @@ DESCRIPTION
implementation is similar to <<%#tx>>), except implementation is similar to <<%#tx>>), except
that <<0x>> appears even for the NULL pointer. that <<0x>> appears even for the NULL pointer.
o m
Prints the output of <<strerror(errno)>>; no
argument is required. A GNU extension.
o- o-
O- O-

View File

@ -1225,6 +1225,15 @@ reswitch: switch (ch) {
sign = '-'; sign = '-';
break; break;
#endif /* FLOATING_POINT */ #endif /* FLOATING_POINT */
#ifdef _GLIBC_EXTENSION
case 'm': /* extension */
{
int dummy;
cp = _strerror_r (data, data->_errno, 1, &dummy);
}
flags &= ~LONGINT;
goto string;
#endif
case 'n': case 'n':
#ifndef _NO_LONGLONG #ifndef _NO_LONGLONG
if (flags & QUADINT) if (flags & QUADINT)
@ -1272,8 +1281,11 @@ reswitch: switch (ch) {
#ifdef _WANT_IO_C99_FORMATS #ifdef _WANT_IO_C99_FORMATS
case 'S': case 'S':
#endif #endif
sign = '\0';
cp = GET_ARG (N, ap, char_ptr_t); cp = GET_ARG (N, ap, char_ptr_t);
#ifdef _GLIBC_EXTENSION
string:
#endif
sign = '\0';
#ifndef __OPTIMIZE_SIZE__ #ifndef __OPTIMIZE_SIZE__
/* Behavior is undefined if the user passed a /* Behavior is undefined if the user passed a
NULL string when precision is not 0. NULL string when precision is not 0.

View File

@ -1074,6 +1074,15 @@ reswitch: switch (ch) {
sign = L'-'; sign = L'-';
break; break;
#endif /* FLOATING_POINT */ #endif /* FLOATING_POINT */
#ifdef _GLIBC_EXTENSION
case L'm': /* GNU extension */
{
int dummy;
cp = (wchar_t *) _strerror_r (data, data->_errno, 1, &dummy);
}
flags &= ~LONGINT;
goto string;
#endif
case L'n': case L'n':
#ifndef _NO_LONGLONG #ifndef _NO_LONGLONG
if (flags & QUADINT) if (flags & QUADINT)
@ -1118,8 +1127,11 @@ reswitch: switch (ch) {
#ifdef _WANT_IO_C99_FORMATS #ifdef _WANT_IO_C99_FORMATS
case L'S': /* POSIX extension */ case L'S': /* POSIX extension */
#endif #endif
sign = '\0';
cp = GET_ARG (N, ap, wchar_ptr_t); cp = GET_ARG (N, ap, wchar_ptr_t);
#ifdef _GLIBC_EXTENSION
string:
#endif
sign = '\0';
#ifndef __OPTIMIZE_SIZE__ #ifndef __OPTIMIZE_SIZE__
/* Behavior is undefined if the user passed a /* Behavior is undefined if the user passed a
NULL string when precision is not 0. NULL string when precision is not 0.
@ -1132,7 +1144,7 @@ reswitch: switch (ch) {
else else
#endif /* __OPTIMIZE_SIZE__ */ #endif /* __OPTIMIZE_SIZE__ */
#ifdef _MB_CAPABLE #ifdef _MB_CAPABLE
if (ch == L's' && !(flags & LONGINT)) { if (ch != L'S' && !(flags & LONGINT)) {
char *arg = (char *) cp; char *arg = (char *) cp;
size_t insize = 0, nchars = 0, nconv = 0; size_t insize = 0, nchars = 0, nconv = 0;
mbstate_t ps; mbstate_t ps;