Date: Fri, 01 Feb 2002 14:37:53 +0000 From: Mark Murray <mark@grondar.za> To: Bruce Evans <bde@zeta.org.au> Cc: Juha Juntunen <estabur@hotmail.com>, arch@FreeBSD.ORG Subject: Re: __P macro question Message-ID: <200202011438.g11EbxE98677@greenpeace.grondar.org> In-Reply-To: <20020202012011.U3304-100000@gamplex.bde.org> ; from Bruce Evans <bde@zeta.org.au> "Sat, 02 Feb 2002 01:31:23 %2B1100." References: <20020202012011.U3304-100000@gamplex.bde.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200202011438.g11EbxE98677>
