[Flex-devel] unicode unsigned short
flex is a tool for generating scanners
Brought to you by:
wlestes
From: Paul <pa...@pr...> - 2012-07-06 15:29:36
|
The unicode16 version of flex uses unsigned short. Without opening a large can of worms re types, to pass the tests utest-posix and utest-posixly-correct (nothing to do with posix compatibility) with the -U flag on, I have altered the line: char * tests[NUM_TESTS] = { "ababab"}; /* non unicode */ to (simplified): unsigned short testu[7]={'a','b','a','b','a','b',0}; /* altered for unicode pn */ The test then passes with testu OK. This makes initializing a pain since: a. wchar_t is 4 bytes wide in gcc b. L"ababab" is also 4 bytes wide. whereas unsigned short & unicode 16 is 2 bytes wide. I will note that char16_t is not defined in C, only C++. Thoughts please. Paul |