From owner-svn-src-all@FreeBSD.ORG Thu Sep 3 14:04:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34F251065676 for ; Thu, 3 Sep 2009 14:04:27 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from www.sonnenberger.org (www.sonnenberger.org [92.79.50.50]) by mx1.freebsd.org (Postfix) with ESMTP id A76F28FC0A for ; Thu, 3 Sep 2009 14:04:26 +0000 (UTC) Received: from britannica.bec.de (www.sonnenberger.org [192.168.1.10]) by www.sonnenberger.org (Postfix) with ESMTP id CFC87667A3 for ; Thu, 3 Sep 2009 16:04:24 +0200 (CEST) Received: by britannica.bec.de (Postfix, from userid 1000) id 40AA71BDDA5; Thu, 3 Sep 2009 16:03:46 +0200 (CEST) Date: Thu, 3 Sep 2009 16:03:46 +0200 From: Joerg Sonnenberger To: svn-src-all@freebsd.org Message-ID: <20090903140346.GA11785@britannica.bec.de> 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> <20090903115416.GB448@britannica.bec.de> <86vdk0upmh.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <86vdk0upmh.fsf@ds4.des.no> User-Agent: Mutt/1.5.19 (2009-01-05) Subject: Re: svn commit: r196752 - head/lib/libc/stdtime X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Sep 2009 14:04:27 -0000 On Thu, Sep 03, 2009 at 03:25:26PM +0200, Dag-Erling Smørgrav wrote: > > This is actually not good enough. ISO C doesn't specify whether plain > > char is signed or unsigned. > > This is FreeBSD. Our char is signed. On systems where it isn't (IRIX > is the only one I know of), the cast is a no-op. GCC's default for ARM is unsigned. Just to name the most popular platform. I don't know if FreeBSD has local patches, but I expect a non-trivial amount of code is ported from/to ARM systems as well. > > > Also, isascii is the only exception to this rule, so the change for that > > is wrong. > > No. The fact that isascii() accidentally returns the correct answer > even in the absence of a cast is irrelevant. Passing a signed char to > isascii() invokes undefined behavior. To quote SUS: The isascii() function shall return non-zero if c is a 7-bit US-ASCII character code between 0 and octal 0177 inclusive; otherwise, it shall return 0. Joerg