Date: Sun, 25 Nov 2012 09:13:28 +0400 From: Andrey Chernov <ache@freebsd.org> To: Dimitry Andric <dim@FreeBSD.org> Cc: Andrew Turner <andrew@FreeBSD.org>, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r243474 - head/usr.bin/cut Message-ID: <50B1A8F8.9090302@freebsd.org> In-Reply-To: <50B0DF04.5060001@freebsd.org> References: <201211240415.qAO4FPaG062952@svn.freebsd.org> <50B07EB6.3010503@freebsd.org> <50B0D5B3.9000802@FreeBSD.org> <50B0DF04.5060001@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50B1A8F8.9090302>