[Patch] libc++: Add a default rune table

Ed Schouten ed at 80386.nl
Wed Dec 10 08:58:44 PST 2014


Hi Jonathan,

Thanks for the quick response!

2014-12-10 15:46 GMT+01:00 Jonathan Roelofs <jonathan at codesourcery.com>:
> Dan, didn't you file a PR saying that libc++ should just have its own table,
> and use that for everything?

That would be nice! One of the things we could then consider doing, is
declaring the table as having 256 elements. Right now we have quite a
lot of functions in libc++ that do something like:

bool isalpha(char c) {
  return isascii(c) ? (classic_table[c] & alpha) != 0 : false;
}

The problem with this approach is that isascii() is an obsolete X/Open
system interfaces function.

The code could be changed to manually test whether the value is <=
127, but if the classic_table would grow to 256, there shouldn't even
be a reason to do the bounds checking.

Thoughts?

-- 
Ed Schouten <ed at 80386.nl>



More information about the cfe-commits mailing list