--- In [email protected], Thomas Hruska <[EMAIL PROTECTED]> wrote:
>
> odbapsvm wrote:
> > void main(void) {
> > 
> >    void main();
> > }
>
> What is the deal with people putting void, int, whatever in front of
the 
> function call?

Assuming the OP meant

    (void) main();

if you call a function that returns a value which you ignore, this
might be a bug - either you should be doing something with it, or the
function shouldn't be returning a value. Programs such as Gimpel's
excellent PC/Flexe-Lint will issue a warning, so to tell it (and
anyone else who might be reviewing your code) that you know what you
are doing, you stick a void cast in front of the call. It's a
self-documenting code thing.

Gimpel's lint also allows you to tell it functions whose values it is
(usually) ok to ignore eg. printf(), so you don't have to keep void
casting their returns.

John

Reply via email to