DragonFly BSD
DragonFly submit List (threaded) for 2004-01
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: patch to un-K&R-ify libkern


From: Joerg Sonnenberger <joerg@xxxxxxxxxxxxxxxxx>
Date: Tue, 27 Jan 2004 11:47:10 +0100

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 



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]