This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
wprintf is not a new ISO C99 function
- To: libc-alpha at sources dot redhat dot com
- Subject: wprintf is not a new ISO C99 function
- From: Markus Kuhn <Markus dot Kuhn at cl dot cam dot ac dot uk>
- Date: Wed, 20 Sep 2000 15:28:07 +0100
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/>