After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 325249 - gcc warning when using g_rmdir from <glib/gstdio.h>
gcc warning when using g_rmdir from <glib/gstdio.h>
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.9.x
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2005-12-29 17:53 UTC by Jani Monoses
Modified: 2006-01-05 06:22 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14



Description Jani Monoses 2005-12-29 17:53:06 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:
Comment 1 Matthias Clasen 2005-12-30 01:51:16 UTC
Hmm, thats bad, since we cannot portably include unistd.h in gstdio.h. 
Tor, any ideas ?
Comment 2 Manish Singh 2005-12-30 02:02:15 UTC
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.
Comment 3 Matthias Clasen 2005-12-30 02:07:32 UTC
sounds good to me
Comment 4 Matthias Clasen 2006-01-03 02:55:31 UTC
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)
Comment 5 Manish Singh 2006-01-05 06:22:02 UTC
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)