From owner-freebsd-current Sat Feb 1 16:21:29 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A389637B401; Sat, 1 Feb 2003 16:21:27 -0800 (PST) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id DECF343F75; Sat, 1 Feb 2003 16:21:26 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.12.6/8.12.6) with ESMTP id h120LOSJ018101; Sat, 1 Feb 2003 16:21:24 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.6/8.12.6/Submit) id h120LOId018100; Sat, 1 Feb 2003 16:21:24 -0800 (PST) Date: Sat, 1 Feb 2003 16:21:24 -0800 (PST) From: Matthew Dillon Message-Id: <200302020021.h120LOId018100@apollo.backplane.com> To: Juli Mallett Cc: Bakul Shah , Mark Murray , Julian Elischer , current@FreeBSD.ORG Subject: Re: Style fixups for proc.h References: <200302012315.h11NFVaX028348@grimreaper.grondar.org> <200302020002.TAA24089@warspite.cnchost.com> <20030201161408.B64200@FreeBSD.org> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG :If a named prototype clashes with something in global scope, :isn't it still a shadowing issue? They should probably never :be *in* scope. :-- :Juli Mallett :AIM: BSDFlata -- IRC: juli on EFnet I finally was able to reproduce the bug. But it's an obvious bug in the compiler at least in regards to named arguments in prototypes. The -Wshadow switch causes the error message to be produced and it occurs both for named arguments in prototypes and, named arguments in the procedure proper, and named locals in the procedure. The solution is simply to name the arguments in the prototype the same as the arguments in the procedure. If we are going to use -Wshadow then the arguments in the procedure will generate the error too so naming the prototype arguments the same will not make things any better OR worse. So the prototype arguments should either be named the same as those in the procedure proper, or should not be named at all. We definitely should not go adding underscores to the prototypes to work around this problem. -Matt Matthew Dillon int x; int fubar(int x); int fubar(int y) { int x = 2; ++x; y = 1; return(1); } int fubar2(int x) { ++x; return(1); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message