llvm-project
llvm-project copied to clipboard
Wide character type is inconsistent with Zilog ABI
ZDS II defines wchar_t as follows:
#ifndef WCHAR_T_DEFINED
#define WCHAR_T_DEFINED
typedef unsigned short wchar_t;
#endif
Meanwhile in ez80-clang, it's defined as SignedShort: https://github.com/jacobly0/llvm-project/blob/005a99ce2569373524bd881207aa4a1e98a2b238/clang/lib/Basic/Targets/Z80.h#L36
This type is unlikely to have been used yet in existing code, so it might be good to fix it sooner than later as there's beginning to be some implementation of the C wide character functions.
Signed wide characters would also cause a collision with WEOF if it's defined as -1 (as it is in the CE toolchain).