[llvm-commits] RFC: new tool: llvm-strings

Marshall Clow mclow.lists at gmail.com
Tue Nov 13 11:47:48 PST 2012


[ Resending to the list ]

On Nov 13, 2012, at 8:50 AM, Dmitri Gribenko <gribozavr at gmail.com> wrote:

>>> +bool isPrintable( char c ) {
>>> +  return isalnum(c) ||
>>> +         ispunct(c) ||
>>> +         (isspace(c) && (!iscntrl(c) || c == '\t')) ||
>>> +         (isascii(c) && isprint(c));
>>> +//  Easy to replace this with a table at some point
>>> +  }
>>> 
>>> isalpha() & friends are locale-dependent.
>> 
>> Yes.
>> Is that a problem?
>> [ Seriously. I can see arguments either way. ]
> 
> As a user, I would not expect toolchain output to depend on locale.

Really? I just checked FreeBSD's strings, as well as the GNU one.
Both use isprint(), etc to check to see if something is printable.

Apple's implementation (derived from BSD 4.3), on the other hand, does not.

-- Marshall

Marshall Clow     Idio Software   <mailto:mclow.lists at gmail.com>

A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
       -- Yu Suzuki





More information about the llvm-commits mailing list