This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
How should vwprintf() work?
- From: Petter Reinholdtsen <pere at hungry dot com>
- To: libc-alpha at sources dot redhat dot com
- Date: Wed, 21 Jul 2004 23:55:59 +0200
- Subject: How should vwprintf() work?
Based on this failure claim on
<URL:http://www.dinkumware.com/conform_c.html>, I started looking on
how vwprintf() work.
- If L"" is passed as the format parameter to vwprintf a negative
value is returned, indicating an error occurred.
The vwprintf() function seem to terminate the program or block any
printf() after it is called, or fail if a printf() was called first.
Look at this example:
% cat > x.c
#include <stdio.h>
#include <wchar.h>
#include <stdarg.h>
int main()
{
va_list args;
int i;
#if defined(TEST)
printf("started\n");
#endif /* TEST */
i = vwprintf(L"", args);
printf("retval: %d\n", i);
printf("ended\n");
return 0;
}
% cc -Wall x.c ; ./a.out
x.c: In function `main':
x.c:11: warning: implicit declaration of function `vwprintf'
% cc -DTEST -Wall x.c ; ./a.out
x.c: In function `main':
x.c:11: warning: implicit declaration of function `vwprintf'
started
retval: -1
ended
%
Is this a bug? I'm testing on Debian/Unstable.