From owner-svn-src-head@FreeBSD.ORG Fri Sep 4 05:16:33 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 3DF67106566C; Fri, 4 Sep 2009 05:16:33 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id AA59B8FC19; Fri, 4 Sep 2009 05:16:32 +0000 (UTC) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.3/8.14.3) with ESMTP id n845GUC0088693; Fri, 4 Sep 2009 09:16:30 +0400 (MSD) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nagual.pp.ru; s=default; t=1252041390; bh=ydCGVf7poqXsYuVQZAYbsqmAFVy1dLa2XkLuQToqAE8=; l=2030; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=CYQ/7979kiWaVAzJ3zXw49+4O08mgqekyosG3IDpdxXmA9gClEvUusjVL/SbT6BLa F9xEZKdI1wsDPdDgCHy2xL30ZzzjWZwMH5OrkA9MbihlxQrJXMN+etZq5fgVJAn02U eOidY59OoV+B4RBKhKl/ok1LSCnkRq842B/oeX50= Received: (from ache@localhost) by nagual.pp.ru (8.14.3/8.14.3/Submit) id n845GTfe088692; Fri, 4 Sep 2009 09:16:29 +0400 (MSD) (envelope-from ache) Date: Fri, 4 Sep 2009 09:16:29 +0400 From: Andrey Chernov To: Bruce Evans Message-ID: <20090904051629.GA88503@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Bruce Evans , Dag-Erling Sm??rgrav , "Simon L. Nielsen" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.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: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090904115255.Q48987@delplex.bde.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, Dag-Erling Sm??rgrav , 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: Fri, 04 Sep 2009 05:16:33 -0000 On Fri, Sep 04, 2009 at 01:42:04PM +1000, Bruce Evans wrote: > The patch is missing the corresponding text for wctype functions > (argmuments of type wint_t generally give undefined behaviour unless > their value is representable as a wchar_t or equal to the value of > WEOF). In FreeBSD, wint_t has the same type as wchar_t and that type > is int, so bugs in this area are latent (unportable code might run > on FreeBSD, and there might be problems with the sign bit and/or with > WEOF being indistinguishable from a valid wide char encoding. Yes, having the same note for wctype family will be nice too. > 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 must be converted to one representable as an unsigned char to > work, but that is not always possible, and blindly casting may give > a wrong value. > Exotic machines include: I think, "exotic machines" examples you mention already brokes too many other aspects regarding to char manipulating, so nobody will really make such machines with standard-compliance C compiler on them :) > Sign extension for passing a signed char is not an error. The error is > passing a negative value. Yes. Perhaps 'Never pass negative arg there, including sign-extended char' or something alike. > Neither C99 nor POSIX gives any advice. They just say that the behaviour > is undefined if the value is not representable as an unsigned char or > equal to the value of EOF. Yes, I already mention that. > % Index: lib/libc/locale/isrune.3 > % Index: lib/libc/locale/digittoint.3 > % Index: lib/libc/locale/isascii.3 > % Index: lib/libc/locale/toascii.3 Yes, those ones works with int. I don't pay attention to them in the whole patch :( About other wording nuances mentioned in your reply, I don't have an opinion, everybody knows my English is poor :) -- http://ache.pp.ru/