[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.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4