Skip to content

Commit 5079e09

Browse files
jdx-ghjjohnstn
authored andcommitted
Fix newlib/testsuite/newlib.wctype/twctype.c compilation for 16-bit targets
When the test case is compiled for a target with a 16-bit wint_t, the compiler emits the two warnings shown below, causing the test to fail. The code assumes that wint_t is 32 bits wide, which is not always the case. This patch fixes the issue. Signed-off-by: Jan Dubiec <jdx@o2.pl>
1 parent e4837fb commit 5079e09

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

newlib/testsuite/newlib.wctype/twctype.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,13 @@ int main()
3939
setlocale (LC_CTYPE, "C-UTF-8");
4040
CHECK (iswalpha(0x0967));
4141
CHECK (!iswalpha(0x128e));
42+
#if __SIZEOF_WINT_T__ > 2
43+
/* These two lines may cause compilation warnings on targets
44+
where wint_t is 16 bits wide, which in turn causes the test
45+
case to fail. */
4246
CHECK (iswalnum(0x1d7ce));
4347
CHECK (!iswalnum(0x1d800));
48+
#endif
4449
CHECK (iswcntrl(0x007f));
4550
CHECK (!iswcntrl(0x2027));
4651
CHECK (iswdigit(L'2'));

0 commit comments

Comments
 (0)