Thread: [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 |
From: Peter M. <pet...@gm...> - 2012-07-06 15:36:14
|
Uint16t? On Jul 6, 2012 11:29 AM, "Paul" <pa...@pr...> wrote: > 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 > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Flex-devel mailing list > Fle...@li... > https://lists.sourceforge.net/lists/listinfo/flex-devel > |
From: Paul <pa...@pr...> - 2012-07-06 16:08:29
|
No Uint16t in gcc. Is a Micrsoft-ism. glibc has <stdint.h> which has uint16_t but not universal. Paul On 07/06/2012 11:36 AM, Peter Martini wrote: > > Uint16t? > > |
From: Peter M. <pet...@gm...> - 2012-07-06 16:11:13
|
Sorry, sent from my phone, I did mean uint16_t :-) And I thought that it was mandated by C99 - is there something in particular that doesn't support it? On Fri, Jul 6, 2012 at 12:08 PM, Paul <pa...@pr...> wrote: > No Uint16t in gcc. Is a Micrsoft-ism. > > glibc has <stdint.h> which has uint16_t but not universal. > > Paul > > On 07/06/2012 11:36 AM, Peter Martini wrote: > >> >> Uint16t? >> >> >> > |
From: Paul <pa...@pr...> - 2012-07-06 16:34:08
|
using gcc & glibc <stdint.h> uint16_t *x=UINT16_C("ababab"); compiles to: in hex: 6261, 6261, 6261,0 Thus the initialization problem asked about is still not solved. Paul On 07/06/2012 12:11 PM, Peter Martini wrote: > Sorry, sent from my phone, I did mean uint16_t :-) And I thought that > it was mandated by C99 - is there something in particular that doesn't > support it? > > On Fri, Jul 6, 2012 at 12:08 PM, Paul <pa...@pr... > <mailto:pa...@pr...>> wrote: > > No Uint16t in gcc. Is a Micrsoft-ism. > > glibc has <stdint.h> which has uint16_t but not universal. > > Paul > > On 07/06/2012 11:36 AM, Peter Martini wrote: > > > Uint16t? > > > > |
From: Paul <pa...@pr...> - 2012-07-06 17:49:29
|
I think now that this is a C problem & not a flex problem. Paul On 07/06/2012 12:34 PM, Paul wrote: > using gcc & glibc <stdint.h> > uint16_t *x=UINT16_C("ababab"); > compiles to: in hex: > 6261, 6261, 6261,0 > > Thus the initialization problem asked about is still not solved. > > Paul > > On 07/06/2012 12:11 PM, Peter Martini wrote: >> Sorry, sent from my phone, I did mean uint16_t :-) And I thought that >> it was mandated by C99 - is there something in particular that >> doesn't support it? >> >> On Fri, Jul 6, 2012 at 12:08 PM, Paul <pa...@pr... >> <mailto:pa...@pr...>> wrote: >> >> No Uint16t in gcc. Is a Micrsoft-ism. >> >> glibc has <stdint.h> which has uint16_t but not universal. >> >> Paul >> >> On 07/06/2012 11:36 AM, Peter Martini wrote: >> >> >> Uint16t? >> >> >> >> > > > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > > > _______________________________________________ > Flex-devel mailing list > Fle...@li... > https://lists.sourceforge.net/lists/listinfo/flex-devel |