GNOME Bugzilla – Bug 325249
gcc warning when using g_rmdir from <glib/gstdio.h>
Last modified: 2006-01-05 06:22:02 UTC
Please describe the problem: /usr/include/glib-2.0/glib/gstdio.h should include <unistd.h> for the declaration of rmdir. All other functions wrapped by g_XXX (open, mkdir) macros come from <sys/stat.h> which is included, but not rmdir. So compiling a file that uses g_rmdir after including glib/gstdio.h results is warning: implicit declaration of function 'rmdir' Steps to reproduce: 1. 2. 3. Actual results: Expected results: Does this happen every time? Other information:
Hmm, thats bad, since we cannot portably include unistd.h in gstdio.h. Tor, any ideas ?
Mmm, they were made #defines to avoid 32/64-bit file offset confusion. However, rmdir (and chdir, mkdir, etc.) only take pathnames, not filehandles, so perhaps these should be turned into real functions that wrap simply wraps the actual libc call. Leave open, stat, etc. as #defines still.
sounds good to me
2006-01-02 Matthias Clasen <mclasen@redhat.com> * glib/glib.symbols: * glib/gstdio.h: * glib/gstdio.c (g_rmdir): Don't provide g_rmdir() as a macro expanding to rmdir, since rmdir is not declared in a portable system header we can include in gstdio.h. (#325249, Jani Monoses)
2006-01-04 Manish Singh <yosh@gimp.org> * glib/glib.symbols * glib/gstdio.h: don't macroized g_access, g_chdir, and g_unlink either, since they have the same issue as g_rmdir. (Related to bug #325249)