From owner-freebsd-current Sat Feb 1 16: 3:14 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 76BA337B401 for ; Sat, 1 Feb 2003 16:03:13 -0800 (PST) Received: from warspite.cnchost.com (warspite.concentric.net [207.155.248.9]) by mx1.FreeBSD.org (Postfix) with ESMTP id C810643F75 for ; Sat, 1 Feb 2003 16:03:12 -0800 (PST) (envelope-from bakul@bitblocks.com) Received: from bitblocks.com (adsl-209-204-185-216.sonic.net [209.204.185.216]) by warspite.cnchost.com id TAA24089; Sat, 1 Feb 2003 19:02:58 -0500 (EST) [ConcentricHost SMTP Relay 1.15] Message-ID: <200302020002.TAA24089@warspite.cnchost.com> To: Mark Murray Cc: Julian Elischer , current@FreeBSD.ORG Subject: Re: Style fixups for proc.h In-reply-to: Your message of "Sat, 01 Feb 2003 23:15:31 GMT." <200302012315.h11NFVaX028348@grimreaper.grondar.org> Date: Sat, 01 Feb 2003 16:02:57 -0800 From: Bakul Shah 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 > Julian Elischer writes: > > I don't know about the protection with a '_'. > > > > It's not standard and usually the name matches that used in the actual > > function. > > When the prototype parameter name matches a local variable, the C compiler > (and lint) whine about clashes between names in local/global namespace. According to C99, a function prototype has its own scope or name space. It terminates at the end of the function declarator. Basically naming a parameter in a function prototype is an aide to the human user; it is not needed for correct compilation[1] so this warning is bogus. As the spec says in section 6.7.5.3 (according the draft I have) "The identifiers [naming parameters] are declared for descriptive purposes only and go out of scope at the end of the [prototype] declaration". I can't see what actual error is avoided by this warning. > 2 ways to fix this are to "protect" the prototype argument names with the > "_", or to remove the argument name altogether. Why not fix the compiler & lint instead of cluttering up declarations? -- bakul [1] Except for what is needed for declaring flexible or variable length array parameters. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message