[Python-Dev] RE: [Python-checkins] CVS: python/dist/src/Python ceval.c,2.200,2.201

Tim Peters tim_one@email.msn.com
Thu, 31 Aug 2000 23:12:25 -0400


[Greg Stein]
> ...
> static int foo(void) { ... }
> int bar() { ... }
>
> You're setting yourself up for inconsistency if you don't always use a
> prototypical definition. In the above example, foo() must be
> declared/defined using a prototype (or you get warnings from gcc when you
> compile with -Wmissing-prototypes (which is recommended for developers)).
> But you're saying bar() should *not* have a prototype.

This must be about the pragmatics of gcc, as the C std doesn't say any of
that stuff -- to the contrary, in a *definition* (as opposed to a
declaration), bar() and bar(void) are identical in meaning (as far as the
std goes).

But I confess I don't use gcc at the moment, and have mostly used C
grudgingly the past 5 years when porting things to C++, and my "bad style"
really came from the latter (C++ doesn't cater to K&R-style decls or
"Miranda prototypes" at all, so "thing(void)" is just an eyesore there).

> -1 on dropping the "void" from the definition. I disagree it is bad form,
> and it sets us up for inconsistencies.

Good enough for me -- I'll change it back.