https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124156

            Bug ID: 124156
           Summary: wchar_t and wint_t are wrong for msp430
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---
            Target: msp430

>From https://fosstodon.org/@keithp/116090169981745060 :

config/msp430/msp430.h:
```
#undef  WCHAR_TYPE
#define WCHAR_TYPE                      "long int"
#undef  WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE                 BITS_PER_WORD
```

So that makes WCHAR_TYPE_SIZE 16bit but WCHAR_TYPE is long which is 32bit. That
is wrong. And could cause an issue with D front-end vs the C/C++ front-end.


defaults.h:
```
#ifndef WINT_TYPE
#define WINT_TYPE "unsigned int"
#endif
```


Also if I read the C99 standard correctly there is a requirement for
sizeof(wint_t) >= sizeof (wchar_t) as all wchar_t must be representable in
wint_t (except for one which is reserved for the EOF).

Reply via email to