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]

wprintf is not a new ISO C99 function


In the current snapshot, in /usr/include/wchar.h it says

/* Wide character I/O functions.  */
#if defined __USE_ISOC99 || defined __USE_UNIX98
            ^^^^^^^^^^^^

/* Select orientation for stream.  */
extern int fwide (__FILE *__fp, int __mode) __THROW;


/* Write formatted output to STREAM.  */
extern int fwprintf (__FILE *__restrict __stream,
                     __const wchar_t *__restrict __format, ...)
     __THROW /* __attribute__ ((__format__ (__wprintf__, 2, 3))) */;
/* Write formatted output to stdout.  */
extern int wprintf (__const wchar_t *__restrict __format, ...)
     __THROW /* __attribute__ ((__format__ (__wprintf__, 1, 2))) */;

...

All these functions have been part of the C89 standard since amendment 1
(1994). They are NOT new additions to ISO C99 and should therefore be added
unconditionally by default. If someone adds #include <wchar.h> to her
source code, then she will most definitely also want to have these old
functions included.

A trivial ISO C89 program such as

#include <wchar.h>

int main() {
  wprintf(L"Schöne Grüße!\n");

  return 0;
}

should run without the necessity to prefix any #define _ISOC99_SOURCE

Markus

-- 
Markus G. Kuhn, Computer Laboratory, University of Cambridge, UK
Email: mkuhn at acm.org,  WWW: <http://www.cl.cam.ac.uk/~mgk25/>


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