svn commit: r243474 - head/usr.bin/cut

Andrey Chernov ache at freebsd.org
Sun Nov 25 05:13:30 UTC 2012


On 24.11.2012 18:51, Andrey Chernov wrote:
> On 24.11.2012 18:12, Dimitry Andric wrote:
>>>> -is_delim(int ch)
>>>> +is_delim(wchar_t ch)
>>>>   {
>>>>       if (wflag) {
>>>>           if (ch == ' ' || ch == '\t')
>>>>
>>>
>>> I can't look at the whole code at this moment, but taking standalone
>>> this is incorrect comparison for wchar_t. Should be L' ' and L'\t'
>>> instead.
>>
>> The compiler just promotes the space and tab to wchar_t, this is only
>> needed for the sake of consistency (and/or style).  There is no binary
>> change if you add the L prefixes. :)
> 
> In general case byte order of type promotion is not necessary equal to
> byte order of L'x' literals.
> 

Forget to note that this point "The compiler just promotes the space and
tab to wchar_t" is wrong. Since there are no direct (wchar_t) cast,
compiler promotes both to the nearby integer type.


More information about the svn-src-head mailing list