From owner-freebsd-arch Thu Jan 31 19: 6:36 2002 Delivered-To: freebsd-arch@freebsd.org Received: from rover.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id 9359737B419 for ; Thu, 31 Jan 2002 19:06:32 -0800 (PST) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.11.3/8.11.3) with ESMTP id g1136Bo39098; Thu, 31 Jan 2002 20:06:12 -0700 (MST) (envelope-from imp@village.org) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.11.6/8.11.6) with ESMTP id g11367x36254; Thu, 31 Jan 2002 20:06:08 -0700 (MST) (envelope-from imp@village.org) Date: Thu, 31 Jan 2002 20:05:49 -0700 (MST) Message-Id: <20020131.200549.85420016.imp@village.org> To: tlambert2@mindspring.com Cc: drosih@rpi.edu, Todd.Miller@courtesan.com, perry@wasabisystems.com, wes@softweyr.com, asmodai@wxs.nl, mckusick@mckusick.com, arch@FreeBSD.ORG, peter@wemm.org, phk@critter.freebsd.dk, deatley@apple.com, jkh@winston.freebsd.org, deraadt@cvs.openbsd.org Subject: Re: __P macro question From: "M. Warner Losh" In-Reply-To: <3C59FAFA.1EE9B153@mindspring.com> References: <20020131.153607.63055791.imp@village.org> <3C59FAFA.1EE9B153@mindspring.com> X-Mailer: Mew version 2.1 on Emacs 21.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message: <3C59FAFA.1EE9B153@mindspring.com> Terry Lambert writes: : "M. Warner Losh" wrote: : > : static int sendfile __P((struct printer *pp, int type, char *file, : > : int format)); : > : : > : for a procedure declaration of: : > : static int : > : sendfile(pp, type, file, format) : > : struct printer *pp; : > : int type; : > : char *file; : > : char format; : > : { : > : > That's *EXCATLY* why I'm converting the old, but still legal in c89, : > style to new style. You get warnings that you didn't get before. : : The compiler is broken, if it accepts the second when the : first prototype is in scope. : : It's a broken compiler, period. : : Conversion doesn't fix the compiler brokeness. Fine. Gcc is broken. I found at least one case of it in the tree already. :-) That's because char is promoted to int when "old style" are used, and not when new style are used. At least that's the only explaination I can think of and I don't care enough to go find the verbage from the standard that says this. That's one of the *@#(%&#^% subtle differences between K&R and ANSI that bite you when you least expect it. int foo9(int a); int foo9(a) char a; { } doesn't produce an error but: int foo9(int a); int foo9(char a) { } does. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message