This is the mail archive of the
mailing list for the glibc project.
[Bug libc/20639] Inconsistency in definitions of fputwc(), putwc() and putwchar() in glibc
- From: "igor.liferenko at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Thu, 06 Oct 2016 05:27:09 +0000
- Subject: [Bug libc/20639] Inconsistency in definitions of fputwc(), putwc() and putwchar() in glibc
- Auto-submitted: auto-generated
- References: <firstname.lastname@example.org/bugzilla/>
--- Comment #3 from Igor Liferenko <igor.liferenko at gmail dot com> ---
The solution is found.
In C standard they should remove wint_t everywhere (or make it the same type as
wchar_t - for backward compatibility) and use only wchar_t (because wchar_t can
already hold all character values + WEOF), and make WEOF the same type as
wchar_t. This way there will be no inconsistency in function interfaces. In
the C standard (9899:201x 7.29) mentions: "wchar_t and wint_t can be the same
integer type." Subsequently, when gcc will be fixed according to the new
standard, the warnings will disappear.
Until then, to avoid warnings when "-Wconversion" is used, add this at the
beginning of a program:
#define __WINT_TYPE__ int
(for "-Wsign-compare" use "#define WEOF (-1)" before "#input <wchar.h>")
In the above paragraph it is assumed that wint_t is unsigned.
You are receiving this mail because:
You are on the CC list for the bug.