From owner-svn-src-head@FreeBSD.ORG Fri Sep 4 05:21:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB0171065697; Fri, 4 Sep 2009 05:21:21 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id 3F2978FC2A; Fri, 4 Sep 2009 05:21:20 +0000 (UTC) Received: from c220-239-231-153.carlnfd4.nsw.optusnet.com.au (c220-239-231-153.carlnfd4.nsw.optusnet.com.au [220.239.231.153]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n845L8mU000765 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 4 Sep 2009 15:21:09 +1000 Date: Fri, 4 Sep 2009 15:21:09 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Bruce Evans In-Reply-To: <20090904115255.Q48987@delplex.bde.org> Message-ID: <20090904144214.O49099@delplex.bde.org> References: <200909020456.n824uUqQ082136@svn.freebsd.org> <20090902070808.GA1290@arthur.nitro.dk> <20090902084002.GA17325@nagual.pp.ru> <867hwgcwvo.fsf@ds4.des.no> <20090903084325.GA65192@nagual.pp.ru> <86zl9c9z05.fsf@ds4.des.no> <20090904115255.Q48987@delplex.bde.org> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1394947128-1252041669=:49099" Cc: src-committers@freebsd.org, Andrey Chernov , svn-src-all@freebsd.org, "Simon L. Nielsen" , svn-src-head@freebsd.org, =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= Subject: Re: svn commit: r196752 - head/lib/libc/stdtime X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Sep 2009 05:21:21 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-1394947128-1252041669=:49099 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Fri, 4 Sep 2009, Bruce Evans wrote: > On Thu, 3 Sep 2009, [utf-8] Dag-Erling Sm=C3=B8rgrav wrote: > >> What do you think of the attached patch? Oops, it is more broken than I noticed. Almost all ctype man pages already documented the requirements in even more detail than POSIX, since Andrey fixed the missing documentation to almost catch up with C99 and POSIX in Y2K, and tjr added more details on 6 Oct 2002. E.g., in isalpha.3: % The value of the argument must be representable as an % .Vt "unsigned char" % or the value of % .Dv EOF . This is the same as in POSIX except the POSIX wording is better (e.g., the above only says implicitly that the behaviour is undefined if "must" is not satisfied). It took too many commits (revs 1.8-1.10) to get this far. % ... % .Sh COMPATIBILITY % The % .Bx 4.4 % extension of accepting arguments outside of the range of the % .Vt "unsigned char" % type in locales with large character sets is considered obsolete % and may not be supported in future releases. % The % .Fn iswalpha % function should be used instead. This was added in rev.1.16. It also has bugs from not being merged with the old documentation about this problem -- it contradicts the "must", yet still doesn't say what the behaviour is for args outside the range: - are they classified as non-alpha, or are characters with (positive) values outside the range actually possible in some locales, with these characters being classified as alpha by this function and handled correctly by all ctype functions - we now have future releases, and the above says that these releases are not permitted to support this behaviour, so why do we still have it ;-) - what happens for the corresponding problem with iswalpha -- will the FreeBSD extension of not having these problems ever be documented or not permitted or actually go away? > % Index: lib/libc/locale/iscntrl.3 > % =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > % --- lib/libc/locale/iscntrl.3=09(revision 196695) > % +++ lib/libc/locale/iscntrl.3=09(working copy) > % @@ -32,7 +32,7 @@ > % .\" @(#)iscntrl.3=098.1 (Berkeley) 6/4/93 > % .\" $FreeBSD$ > % .\" > % -.Dd July 17, 2005 > % +.Dd September 3, 2009 > % .Dt ISCNTRL 3 > % .Os > % .Sh NAME > % @@ -65,6 +65,15 @@ > % .It "\&031\ EM \t032\ SUB \t033\ ESC \t034\ FS \t035\ GS" > % .It "\&036\ RS \t037\ US \t177\ DEL" > % .El > % +.Pp > % +.Em NOTE : > % +if the value passed to the > % +.Fn iscntrl > % +function is a > % +.Vt signed char , > % +as is usually the case, it must be cast to an > % +.Vt unsigned char > % +to avoid sign-extension errors. > > This wording is poor. It should be something like "if the value to be > passed is represented as a signed char" ... I don't know a good easy > way to fix "must be cast ... to avoid sign-extension errors". The "value to be passed" is wrong too, since the problematic negative values must not be passed. Anyway, teaching how to apply casts to satisfy the requirements of the API should be duplicated ad nauseum in man pages even less than the requirement= s of the API. Bruce --0-1394947128-1252041669=:49099--