I was building some source that used libdirect headers with the
-Wmissing-declarations switch and found several prototype problems
with the libdirect headers. In many places, the headers just
declaring a function with giving a proper parameter list. For
example, using
int foo();
instead of
int foo(void);
This is a common mistake for people who switch between C++ and C. The
void-less version is actually not stating anything to the C compiler
about what parameters the function takesm while the version with void
says that the function takes no params. In C++, saying "()" is
exactly the same thing as saying "(void)" in parameter lists, so it's
easy to get in the habit of using the wrong form.
I'm about to commit a change fixing all the places I saw this for
libdirect, but I'm not auditing the rest of the DFB source right now
-- it seems pretty clean based on not seeing any compiler warnings
from those headers.
_______________________________________________
directfb-dev mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev