How should vwprintf() work?
Petter Reinholdtsen
pere@hungry.com
Wed Jul 21 21:56:00 GMT 2004
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.
More information about the Libc-alpha
mailing list