From owner-freebsd-arch Fri Feb 1 6:40:20 2002 Delivered-To: freebsd-arch@freebsd.org Received: from storm.FreeBSD.org.uk (storm.FreeBSD.org.uk [194.242.139.170]) by hub.freebsd.org (Postfix) with ESMTP id 71AAE37B419 for ; Fri, 1 Feb 2002 06:40:11 -0800 (PST) Received: (from uucp@localhost) by storm.FreeBSD.org.uk (8.11.6/8.11.6) with UUCP id g11Ee9g50529; Fri, 1 Feb 2002 14:40:09 GMT (envelope-from mark@grondar.za) Received: from greenpeace.grondar.org (greenpeace [192.168.42.2]) by gratis.grondar.org (Postfix) with ESMTP id 983D157; Fri, 1 Feb 2002 14:38:01 +0000 (GMT) Received: from grondar.za (localhost [127.0.0.1]) by greenpeace.grondar.org (8.11.6/8.11.6) with ESMTP id g11EbxE98677; Fri, 1 Feb 2002 14:38:00 GMT (envelope-from mark@grondar.za) Message-Id: <200202011438.g11EbxE98677@greenpeace.grondar.org> To: Bruce Evans Cc: Juha Juntunen , arch@FreeBSD.ORG Subject: Re: __P macro question References: <20020202012011.U3304-100000@gamplex.bde.org> In-Reply-To: <20020202012011.U3304-100000@gamplex.bde.org> ; from Bruce Evans "Sat, 02 Feb 2002 01:31:23 +1100." Date: Fri, 01 Feb 2002 14:37:53 +0000 From: Mark Murray 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 > Right. I don't trust anyone who is not familiar with this point to > globally remove __P. > > People removing __P should also be familiar with the gcc conterpoint: > > void foo(char); /* Wrong; should be "void foo(int);". */ > void foo(c) char c; {} > > gives undefined behaviour in Standard C, but gcc defines its behaviour > to be do-what-naive-programmer-expects. This is only safe provided the > wrong prototype for foo() is always in scope before foo() is called; > otherwise foo() is sometimes passed an int and sometimes a char, but > foo() expects to be passed either an int or a char depending on whether > the wrong prototype is in scope for the function body. So, does this not effectively make a rule, "You will _always_ properly prototype functions, and make sure that these proper prototypes are in scope before you use (and define) the functions."? M -- o Mark Murray \_ FreeBSD Services Limited O.\_ Warning: this .sig is umop ap!sdn To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message