[cfe-commits] [PATCH] Support for universal character names in identifiers

Jordan Rose jordan_rose at apple.com
Fri Jan 18 17:03:39 PST 2013


On Jan 18, 2013, at 16:52 , Richard Smith <richard at metafoo.co.uk> wrote:

> On Fri, Jan 18, 2013 at 2:56 PM, Jordan Rose <jordan_rose at apple.com> wrote:
>> This is converging, so I'm putting it up on Phabricator for better spot-comments. E-mail review still welcome as well, of course.
>> 
>> http://llvm-reviews.chandlerc.com/D312
>> 
>> 
>>>> One thing I missed before: please don't use iscntrl or isxdigit;
>>>> they're dependent on the current locale (and to be safe, don't use
>>>> isascii either).
>>> 
>>> I understand for iscntrl, but isascii appears a lot and the expanded form is ugly. I guess I'll write my own wrapper.
>> 
>> …do I have to? :-D isascii seems pretty obvious as to its intent, and it's specified to be locale-independent.
> 
> Here's what POSIX says:
> 
> APPLICATION USAGE
> 
> The isascii() function cannot be used portably in a localized application.
> 
> FUTURE DIRECTIONS
> 
> The isascii() function may be removed in a future version.
> 
> CHANGE HISTORY
> 
> Issue 7
> 
> The isascii() function is marked obsolescent.

Ha, okay. Busted by the standard.

static inline bool isASCII(char C) {
  return (signed char)C >= 0;
}



More information about the cfe-commits mailing list