Dear all,

Today I noticed that `wint_t` is a typedef of `unsigned short`. This is
however non-conforming, as the C99 standard says it shall not be changed
by default argument promotions.

This can be noticed from the following program:

```
E:\Desktop>expand -t4 test.c
#include <stdio.h>
#include <wchar.h>

int main(void){
    printf("sizeof(int)    = %u\n", (unsigned)sizeof(int));
    printf("sizeof(wint_t) = %u\n", (unsigned)sizeof(wint_t));
}

E:\Desktop>gcc test.c && a.exe
sizeof(int)    = 4
sizeof(wint_t) = 2
```

```
ISO WG14 N1256 (Draft for C99)
7.24.1 Introduction
  ... ...
    wint_t
which is an integer type unchanged by default argument promotions that
can hold any value corresponding to members of the extended character
set, as well as at least one value that does not correspond to any
member of the extended character set (see WEOF below);278) and
    struct tm
  ... ...
```
(In N1570, the C11 draft, it is in 7.29.1.)

What should we do with it?

-- 
Best regards,
LH_Mouse


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to