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

            Bug ID: 124155
           Summary: WCHAR_TYPE and WCHAR_TYPE_SIZE are a mismatch on arm
           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: arm

```
/* wchar_t is unsigned under the AAPCS.  */
#ifndef WCHAR_TYPE
#define WCHAR_TYPE (TARGET_AAPCS_BASED ? "unsigned int" : "int")

#define WCHAR_TYPE_SIZE BITS_PER_WORD

```

This I think would cause d to fail to work in some cases because the D
front-end uses WCHAR_TYPE_SIZE rather than WCHAR_TYPE:
d/d-target.cc:  this->c.wchar_tsize = (WCHAR_TYPE_SIZE / BITS_PER_UNIT);
d/types.cc:         build_frontend_type (make_unsigned_type (WCHAR_TYPE_SIZE));


These all seems wrong:
```
config/arm/arm.h:#define WCHAR_TYPE_SIZE BITS_PER_WORD
config/arm/freebsd.h:#undef  WCHAR_TYPE_SIZE
config/arm/freebsd.h:#define WCHAR_TYPE_SIZE BITS_PER_WORD
config/arm/linux-gas.h:#undef  WCHAR_TYPE_SIZE
config/arm/linux-gas.h:#define WCHAR_TYPE_SIZE BITS_PER_WORD
```

Reply via email to