lua-users home
lua-l archive

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

> > Do other Windows enthusiasts have something to say about that? In
> > particular, to do that, wouldn't be better 'void(*)()' instead of
> > 'void(*)(void)'?

> No, void(*)() can't prevent the complaint of gcc.  Because "no
> parameter specification" is different from "no parameters" .

I know the two types are different, and that is why I proposed the other.
With '(void)' I am saying the function takes no arguments---which is
wrong---while with '()' I say nothing.

> Some references :

What none of these references explains is why gcc complains when casting
to 'void(*)()' or to any other function pointer, but does not complain
when casting to 'void(*)(void)'.  Unlike (void*) for objects, the type
'void(*)(void)' has nothing special about it to prevent warnings.

>From the point of view of the standard, is all the same. As long as you
keep the reference as a pointer to function (any function!), and cast
it to the correct type when calling it, everything is guaranteed to work.
Why 'void(*)(void)' would be special? Do other compilers have this
same behavior, or is this a gcc kludge?

-- Roberto
lua-l mailing list --
To unsubscribe send an email to