[crossfire] Patch for (void)
Kevin R. Bulgrien
kbulgrien at worldnet.att.net
Sun Mar 4 10:32:35 CST 2007
On Sunday 04 March 2007 05:14, Nicolas Weeger wrote:
> Hello.
>
> The patch
> https://sourceforge.net/tracker/index.php?func=detail&aid=1660388&group_id=13833&atid=313833
> adds (void) to functions instead of () when no argument.
>
> What do you think of that?
>
> I have mixed feelings, I don't like adding unecessary things. On the other
> hand maybe that's the convention we want to follow?
>
> Nicolas
Using "Learning C++, Third Edition, by Erik Nagler" as a reference, the distinction between
void and the absence of void is based on whether the source is C++ or C. In C, empty
parentheses mean "I'll take anything you want to give me." whereas in C++ empty
parentheses mean "no arguments can be passed in".
Unless the source is moving to C++, it seems best to allow the compiler to help find
errors that involve passing of parameters when none should be passed, but that is
from a developer that has worked mostly with other languages and from one who
has limited C experience.
Kevin
More information about the crossfire
mailing list