From owner-svn-src-all@FreeBSD.ORG Tue Feb 3 20:28:47 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 030AC1065691 for ; Tue, 3 Feb 2009 20:28:47 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 3E0568FC14 for ; Tue, 3 Feb 2009 20:28:45 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: (qmail invoked by alias); 03 Feb 2009 20:28:45 -0000 Received: from p54A3EB73.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.235.115] by mail.gmx.net (mp054) with SMTP; 03 Feb 2009 21:28:45 +0100 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX19GrLI1wG5GBDZG8bzsF+nDoscw2aOkqJxLYhQ+6x 8rJGXAIwzc6/M3 Message-ID: <4988A8F8.9050409@gmx.de> Date: Tue, 03 Feb 2009 21:28:40 +0100 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: Daniel Gerzo References: <200902031758.n13HwKHT037144@svn.freebsd.org> In-Reply-To: <200902031758.n13HwKHT037144@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.53 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r188080 - head/lib/libc/string 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: Tue, 03 Feb 2009 20:28:48 -0000 Daniel Gerzo schrieb: > Author: danger (doc committer) > Date: Tue Feb 3 17:58:20 2009 > New Revision: 188080 > URL: http://svn.freebsd.org/changeset/base/188080 > > Log: > - ANSIfy function definitions > - use nul when we are looking for a terminating character where appropriate > > Approved by: imp [...] > Modified: head/lib/libc/string/memchr.c > ============================================================================== > --- head/lib/libc/string/memchr.c Tue Feb 3 17:13:37 2009 (r188079) > +++ head/lib/libc/string/memchr.c Tue Feb 3 17:58:20 2009 (r188080) > @@ -39,10 +39,7 @@ __FBSDID("$FreeBSD$"); > #include > > void * > -memchr(s, c, n) > - const void *s; > - unsigned char c; > - size_t n; > +memchr(const void *s, unsigned char c, size_t n) > { > if (n != 0) { > const unsigned char *p = s; K&R style function definitions work slightly different than ANSI. void f(x) char x; {} fits to the prototype declaration void f(int x); int in the prototype because it has to fit to the default promoted type of the parameter of the K&R function definition! So just moving types < int from the K&R declaration list into the parameter list will break things (as it does here with memchr(), because the prototype declaration correctly uses type int). Conversely void g(char x); void g(x) char x; {} are NOT compatible, but GCC incorrectly accepts this.