From owner-svn-src-head@FreeBSD.ORG Tue Feb 3 20:43:42 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 E16A7106566C; Tue, 3 Feb 2009 20:43:42 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 9DB558FC13; Tue, 3 Feb 2009 20:43:42 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n13KfGWl048518; Tue, 3 Feb 2009 13:41:16 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Tue, 03 Feb 2009 13:41:42 -0700 (MST) Message-Id: <20090203.134142.-2002504318.imp@bsdimp.com> To: christoph.mallon@gmx.de From: "M. Warner Losh" In-Reply-To: <4988AA81.6010903@gmx.de> References: <200902032025.n13KPaCV041012@svn.freebsd.org> <4988AA81.6010903@gmx.de> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r188098 - head/lib/libc/string 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: Tue, 03 Feb 2009 20:43:43 -0000 In message: <4988AA81.6010903@gmx.de> Christoph Mallon writes: : Warner Losh schrieb: : > Author: imp : > Date: Tue Feb 3 20:25:36 2009 : > New Revision: 188098 : > URL: http://svn.freebsd.org/changeset/base/188098 : > : > Log: : > Fix the functions to match prototypes. The K&R definitions differ : > from the ANSI-C prototype due to the 'int promotion' rule. : > : > Modified: : > head/lib/libc/string/memchr.c : > head/lib/libc/string/strmode.c : > head/lib/libc/string/wmemset.c : > : > Modified: head/lib/libc/string/memchr.c : > ============================================================================== : > --- head/lib/libc/string/memchr.c Tue Feb 3 20:01:51 2009 (r188097) : > +++ head/lib/libc/string/memchr.c Tue Feb 3 20:25:36 2009 (r188098) : > @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); : > #include : > : > void * : > -memchr(const void *s, unsigned char c, size_t n) : > +memchr(const void *s, int c, size_t n) : > { : > if (n != 0) { : > const unsigned char *p = s; : > : : This is not correct either, because now *p (of type unsigned char) gets : compared with c (now type int). The manpage of memchr() states that : : "The memchr() function locates the first occurrence of c (converted to : an unsigned char) in string b." : : The part in parentheses now is missing. This will break when you pass a : negative number (e.g. -1, which should locate a byte with all bits set) : to memchr(). I was just trying to fix the build... I'll look into the issues here. There's likely some missing casts. Warner