This is the mail archive of the glibc-bugs@sourceware.org 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]

[Bug libc/20639] Inconsistency in definitions of fputwc(), putwc() and putwchar() in glibc


https://sourceware.org/bugzilla/show_bug.cgi?id=20639

--- 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
fact,
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:
    #undef __WINT_TYPE__
    #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.

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