From owner-svn-src-head@FreeBSD.ORG Thu Sep 3 09:08:28 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 D7E69106566C; Thu, 3 Sep 2009 09:08:28 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 0EC628FC17; Thu, 3 Sep 2009 09:08:27 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id F1FEC6D418; Thu, 3 Sep 2009 09:08:26 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id C8DF5844A4; Thu, 3 Sep 2009 11:08:26 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Andrey Chernov 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> Date: Thu, 03 Sep 2009 11:08:26 +0200 In-Reply-To: <20090903084325.GA65192@nagual.pp.ru> (Andrey Chernov's message of "Thu, 3 Sep 2009 12:43:25 +0400") Message-ID: <86zl9c9z05.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, "Simon L. Nielsen" 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: Thu, 03 Sep 2009 09:08:28 -0000 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Andrey Chernov writes: > Thanx for detailed explanation. np; I've made that mistake many times myself. What do you think of the attached patch? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=ctype-man.diff Index: lib/libc/locale/iscntrl.3 =================================================================== --- lib/libc/locale/iscntrl.3 (revision 196695) +++ lib/libc/locale/iscntrl.3 (working copy) @@ -32,7 +32,7 @@ .\" @(#)iscntrl.3 8.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. .Sh RETURN VALUES The .Fn iscntrl Index: lib/libc/locale/islower.3 =================================================================== --- lib/libc/locale/islower.3 (revision 196695) +++ lib/libc/locale/islower.3 (working copy) @@ -32,7 +32,7 @@ .\" @(#)islower.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 17, 2005 +.Dd September 3, 2009 .Dt ISLOWER 3 .Os .Sh NAME @@ -64,6 +64,15 @@ .It "\&165\ ``u'' \t166\ ``v'' \t167\ ``w'' \t170\ ``x'' \t171\ ``y''" .It "\&172\ ``z''" .El +.Pp +.Em NOTE : +if the value passed to the +.Fn islower +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. .Sh RETURN VALUES The .Fn islower Index: lib/libc/locale/ispunct.3 =================================================================== --- lib/libc/locale/ispunct.3 (revision 196695) +++ lib/libc/locale/ispunct.3 (working copy) @@ -32,7 +32,7 @@ .\" @(#)ispunct.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 17, 2005 +.Dd September 3, 2009 .Dt ISPUNCT 3 .Os .Sh NAME @@ -70,6 +70,15 @@ .It "\&136\ ``^'' \t137\ ``_'' \t140\ ```'' \t173\ ``{'' \t174\ ``|''" .It "\&175\ ``}'' \t176\ ``~''" .El +.Pp +.Em NOTE : +if the value passed to the +.Fn ispunct +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. .Sh RETURN VALUES The .Fn ispunct Index: lib/libc/locale/tolower.3 =================================================================== --- lib/libc/locale/tolower.3 (revision 196695) +++ lib/libc/locale/tolower.3 (working copy) @@ -32,7 +32,7 @@ .\" @(#)tolower.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 17, 2005 +.Dd September 3, 2009 .Dt TOLOWER 3 .Os .Sh NAME @@ -53,6 +53,15 @@ .Vt "unsigned char" or the value of .Dv EOF . +.Pp +.Em NOTE : +if the value passed to the +.Fn tolower +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. .Sh RETURN VALUES If the argument is an upper-case letter, the .Fn tolower Index: lib/libc/locale/isrune.3 =================================================================== --- lib/libc/locale/isrune.3 (revision 196695) +++ lib/libc/locale/isrune.3 (working copy) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 30, 2004 +.Dd September 3, 2009 .Dt ISRUNE 3 .Os .Sh NAME @@ -46,6 +46,15 @@ .Tn ASCII character set, this is equivalent to .Fn isascii . +.Pp +.Em NOTE : +if the value passed to the +.Fn isrune +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. .Sh RETURN VALUES The .Fn isrune Index: lib/libc/locale/isalnum.3 =================================================================== --- lib/libc/locale/isalnum.3 (revision 196695) +++ lib/libc/locale/isalnum.3 (working copy) @@ -32,7 +32,7 @@ .\" @(#)isalnum.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 17, 2005 +.Dd September 3, 2009 .Dt ISALNUM 3 .Os .Sh NAME @@ -75,6 +75,15 @@ .It "\&164\ ``t'' \t165\ ``u'' \t166\ ``v'' \t167\ ``w'' \t170\ ``x''" .It "\&171\ ``y'' \t172\ ``z''" .El +.Pp +.Em NOTE : +if the value passed to the +.Fn isalnum +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. .Sh RETURN VALUES The .Fn isalnum Index: lib/libc/locale/digittoint.3 =================================================================== --- lib/libc/locale/digittoint.3 (revision 196695) +++ lib/libc/locale/digittoint.3 (working copy) @@ -28,7 +28,7 @@ .\" @(#)digittoint.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 6, 2001 +.Dd September 3, 2009 .Dt DIGITTOINT 3 .Os .Sh NAME @@ -46,6 +46,15 @@ function converts a numeric character to its corresponding integer value. The character can be any decimal digit or hexadecimal digit. With hexadecimal characters, the case of the values does not matter. +.Pp +.Em NOTE : +if the value passed to the +.Fn digittoint +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. .Sh RETURN VALUES The .Fn digittoint Index: lib/libc/locale/isalpha.3 =================================================================== --- lib/libc/locale/isalpha.3 (revision 196695) +++ lib/libc/locale/isalpha.3 (working copy) @@ -32,7 +32,7 @@ .\" @(#)isalpha.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 17, 2005 +.Dd September 3, 2009 .Dt ISALPHA 3 .Os .Sh NAME @@ -73,6 +73,15 @@ .It "\&164\ ``t'' \t165\ ``u'' \t166\ ``v'' \t167\ ``w'' \t170\ ``x''" .It "\&171\ ``y'' \t172\ ``z''" .El +.Pp +.Em NOTE : +if the value passed to the +.Fn isalpha +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. .Sh RETURN VALUES The .Fn isalpha Index: lib/libc/locale/isideogram.3 =================================================================== --- lib/libc/locale/isideogram.3 (revision 196695) +++ lib/libc/locale/isideogram.3 (working copy) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 30, 2004 +.Dd September 3, 2009 .Dt ISIDEOGRAM 3 .Os .Sh NAME @@ -41,6 +41,15 @@ The .Fn isideogram function tests for an ideographic character. +.Pp +.Em NOTE : +if the value passed to the +.Fn isideogram +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. .Sh RETURN VALUES The .Fn isideogram Index: lib/libc/locale/isblank.3 =================================================================== --- lib/libc/locale/isblank.3 (revision 196695) +++ lib/libc/locale/isblank.3 (working copy) @@ -28,7 +28,7 @@ .\" @(#)isblank.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 17, 2005 +.Dd September 3, 2009 .Dt ISBLANK 3 .Os .Sh NAME @@ -57,6 +57,15 @@ .Vt "unsigned char" or the value of .Dv EOF . +.Pp +.Em NOTE : +if the value passed to the +.Fn isblank +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. .Sh RETURN VALUES The .Fn isblank Index: lib/libc/locale/isxdigit.3 =================================================================== --- lib/libc/locale/isxdigit.3 (revision 196695) +++ lib/libc/locale/isxdigit.3 (working copy) @@ -32,7 +32,7 @@ .\" @(#)isxdigit.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 17, 2005 +.Dd September 3, 2009 .Dt ISXDIGIT 3 .Os .Sh NAME @@ -71,6 +71,15 @@ .Vt "unsigned char" or the value of .Dv EOF . +.Pp +.Em NOTE : +if the value passed to the +.Fn isxdigit +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. .Sh RETURN VALUES The .Fn isxdigit Index: lib/libc/locale/isdigit.3 =================================================================== --- lib/libc/locale/isdigit.3 (revision 196695) +++ lib/libc/locale/isdigit.3 (working copy) @@ -32,7 +32,7 @@ .\" @(#)isdigit.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd May 4, 2007 +.Dd September 3, 2009 .Dt ISDIGIT 3 .Os .Sh NAME @@ -68,6 +68,15 @@ .Vt "unsigned char" or the value of .Dv EOF . +.Pp +.Em NOTE : +if the value passed to the +.Fn isdigit +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. .Sh RETURN VALUES The .Fn isdigit Index: lib/libc/locale/isgraph.3 =================================================================== --- lib/libc/locale/isgraph.3 (revision 196695) +++ lib/libc/locale/isgraph.3 (working copy) @@ -32,7 +32,7 @@ .\" @(#)isgraph.3 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd July 17, 2005 +.Dd September 3, 2009 .Dt ISGRAPH 3 .Os .Sh NAME @@ -80,6 +80,15 @@ .It "\&166\ ``v'' \t167\ ``w'' \t170\ ``x'' \t171\ ``y'' \t172\ ``z''" .It "\&173\ ``{'' \t174\ ``|'' \t175\ ``}'' \t176\ ``~''" .El +.Pp +.Em NOTE : +if the value passed to the +.Fn isgraph +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. .Sh RETURN VALUES The .Fn isgraph Index: lib/libc/locale/ctype.3 =================================================================== --- lib/libc/locale/ctype.3 (revision 196695) +++ lib/libc/locale/ctype.3 (working copy) @@ -28,7 +28,7 @@ .\" @(#)ctype.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd March 30, 2004 +.Dd September 3, 2009 .Dt CTYPE 3 .Os .Sh NAME @@ -111,6 +111,13 @@ .In ctype.h , or as true functions in the C library. See the specific manual pages for more information. +.Pp +.Em NOTE : +if the value passed to one of these functions is a +.Vt signed char , +as is usually the case, it must be cast to an +.Vt unsigned char +to avoid sign-extension errors. .Sh SEE ALSO .Xr digittoint 3 , .Xr isalnum 3 , Index: lib/libc/locale/isspace.3 =================================================================== --- lib/libc/locale/isspace.3 (revision 196695) +++ lib/libc/locale/isspace.3 (working copy) @@ -32,7 +32,7 @@ .\" @(#)isspace.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 17, 2005 +.Dd September 3, 2009 .Dt ISSPACE 3 .Os .Sh NAME @@ -61,6 +61,15 @@ .Vt "unsigned char" or the value of .Dv EOF . +.Pp +.Em NOTE : +if the value passed to the +.Fn isspace +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. .Sh RETURN VALUES The .Fn isspace Index: lib/libc/locale/isprint.3 =================================================================== --- lib/libc/locale/isprint.3 (revision 196695) +++ lib/libc/locale/isprint.3 (working copy) @@ -32,7 +32,7 @@ .\" @(#)isprint.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 17, 2005 +.Dd September 3, 2009 .Dt ISPRINT 3 .Os .Sh NAME @@ -78,6 +78,15 @@ .It "\&165\ ``u'' \t166\ ``v'' \t167\ ``w'' \t170\ ``x'' \t171\ ``y''" .It "\&172\ ``z'' \t173\ ``{'' \t174\ ``|'' \t175\ ``}'' \t176\ ``~''" .El +.Pp +.Em NOTE : +if the value passed to the +.Fn isprint +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. .Sh RETURN VALUES The .Fn isprint Index: lib/libc/locale/isascii.3 =================================================================== --- lib/libc/locale/isascii.3 (revision 196695) +++ lib/libc/locale/isascii.3 (working copy) @@ -28,7 +28,7 @@ .\" @(#)isascii.3 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd October 6, 2002 +.Dd September 3, 2009 .Dt ISASCII 3 .Os .Sh NAME @@ -47,6 +47,15 @@ .Tn ASCII character, which is any character between 0 and octal 0177 inclusive. +.Pp +.Em NOTE : +if the value passed to the +.Fn isascii +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. .Sh SEE ALSO .Xr ctype 3 , .Xr iswascii 3 , Index: lib/libc/locale/isphonogram.3 =================================================================== --- lib/libc/locale/isphonogram.3 (revision 196695) +++ lib/libc/locale/isphonogram.3 (working copy) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 30, 2004 +.Dd September 3, 2009 .Dt ISPHONOGRAM 3 .Os .Sh NAME @@ -41,6 +41,15 @@ The .Fn isphonogram function tests for a phonographic character. +.Pp +.Em NOTE : +if the value passed to the +.Fn isphonogram +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. .Sh RETURN VALUES The .Fn isphonogram Index: lib/libc/locale/isupper.3 =================================================================== --- lib/libc/locale/isupper.3 (revision 196695) +++ lib/libc/locale/isupper.3 (working copy) @@ -32,7 +32,7 @@ .\" @(#)isupper.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 17, 2005 +.Dd September 3, 2009 .Dt ISUPPER 3 .Os .Sh NAME @@ -64,6 +64,15 @@ .It "\&125\ ``U'' \t126\ ``V'' \t127\ ``W'' \t130\ ``X'' \t131\ ``Y''" .It "\&132\ ``Z''" .El +.Pp +.Em NOTE : +if the value passed to the +.Fn isupper +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. .Sh RETURN VALUES The .Fn isupper Index: lib/libc/locale/toascii.3 =================================================================== --- lib/libc/locale/toascii.3 (revision 196695) +++ lib/libc/locale/toascii.3 (working copy) @@ -28,7 +28,7 @@ .\" @(#)toascii.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd September 3, 2009 .Dt TOASCII 3 .Os .Sh NAME @@ -45,6 +45,15 @@ .Fn toascii function strips all but the low 7 bits from a letter, including parity or other marker bits. +.Pp +.Em NOTE : +if the value passed to the +.Fn toascii +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. .Sh RETURN VALUES The .Fn toascii Index: lib/libc/locale/toupper.3 =================================================================== --- lib/libc/locale/toupper.3 (revision 196695) +++ lib/libc/locale/toupper.3 (working copy) @@ -32,7 +32,7 @@ .\" @(#)toupper.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 17, 2005 +.Dd September 3, 2009 .Dt TOUPPER 3 .Os .Sh NAME @@ -53,6 +53,15 @@ .Vt "unsigned char" or the value of .Dv EOF . +.Pp +.Em NOTE : +if the value passed to the +.Fn toupper +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. .Sh RETURN VALUES If the argument is a lower-case letter, the .Fn toupper Index: lib/libc/locale/isspecial.3 =================================================================== --- lib/libc/locale/isspecial.3 (revision 196695) +++ lib/libc/locale/isspecial.3 (working copy) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 30, 2004 +.Dd September 3, 2009 .Dt ISSPECIAL 3 .Os .Sh NAME @@ -41,6 +41,15 @@ The .Fn isspecial function tests for a special character. +.Pp +.Em NOTE : +if the value passed to the +.Fn isspecial +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. .Sh RETURN VALUES The .Fn isspecial --=-=-=--