Re: g_remove



On Thu, Feb 17, 2011 at 12:45:36PM -0500, Craig Bakalian wrote:
I have gtk and glib as includes?  Am I missing something?

Yes, on Unix the g_-wrappers are often just macros resolving to the
underlying system function.  So you need to

#include <stdio.h>

to get the real declarations (dunno why it's not done automatically in
this case).

If there
wasn't the right include, the build would fail, further, the function
wouldn't remove the file.

On the contrary, unless you pass -Werror=implicit-function-declaration
or an equivalent of that to the compiler the missing declaration just
causes a warning.  The compiler then implicitly constructs the prototype
as `takes whatever argument you happen to pass to it and returns int'
which is sufficiently right here and the program works fine.  All
according to the C standard.

Regards,

Yeti




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