Re: g_remove



C99 has no implicit int shits, so don't ignore compiler's warning and fix it.

David NeÄas: "All according to the C standard". Right, you didn't tell us which one, one could think you mean "every C standard out there". C99 is old enough to be supported by decent compilers, older standards aren't worth mentioning or using.

On 02/17/2011 06:56 PM, David NeÄas wrote:
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

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



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