This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]