[Geany] Minor source touchups
Yura Siamashka
yurand2 at xxxxx
Mon Jan 19 19:06:01 UTC 2009
2009/1/19, Nick Treleaven <nick.treleaven at btinternet.com>:
> On Sun, 11 Jan 2009 02:40:58 -0500
> "Daniel Richard G." <skunk at iSKUNK.ORG> wrote:
>
>> * Various cases of foo() --> foo(void). (Come on guys... the only excuse
>> is
>> if you're older than dirt and still haven't broken your old K&R habits
>> :)
>
> Or you are used to C++ or C99 ;-) My brain keeps saying the 'void'
> is redundant. But I updated my function snippet a while ago to do it
> for me usually.
Here is little example why you should use void, the following code:
void foo() {}
int main()
{
foo(1);
return 0;
}
will compile using gcc -Wall -Wextra without any warrning. If you add
void you will get:
a.c: In function 'main':
a.c:10: error: too many arguments to function 'foo'
Best regards,
Yura Siamashka
More information about the Users
mailing list