patch to un-K&R-ify libkern

Joerg Sonnenberger joerg at britannica.bec.de
Tue Jan 27 02:49:12 PST 2004


On Mon, Jan 26, 2004 at 09:50:35PM -0500, David Cuthbert wrote:
> Joerg Sonnenberger wrote:
> >Commited. Thanks. The addition of (void) to empty_loop() and co
> >is unnecessary.
> 
> ?
> 
> In C (but not C++), "void empty_loop()" is a function taking any number 
> of args, equivalent to "void empty_loop(...)"; the (void) addition 
> prohibits arguments from being passed.  Presumably, this matches a 
> header somewhere?  (Though I didn't see it in the patch.)

Yes, the prototypes are in machine/profile.h. It is common practise
to have the prototypes include (void) and leave it out for the function
declaration. Anyway, if you stumple over a function without prototyp,
that is a bug and should be noticed. Anyway IIRC in ISO C a function
without arguments might be considered as K&R style and therefore an
implicit (...) is assumed. This does not happen if a ISO prototyp was found.

Joerg 





More information about the Submit mailing list