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 163133 - [CYGWIN] Win32-specific compile warning fix
[CYGWIN] Win32-specific compile warning fix
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: win32
2.6.x
Other Windows
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-win32 maintainers
Depends on:
Blocks:
 
 
Reported: 2005-01-06 15:47 UTC by Roger Leigh
Modified: 2005-01-09 22:56 UTC
See Also:
GNOME target: ---
GNOME version: 2.7/2.8


Attachments
Patch to correct compiler warning and missing header (551 bytes, patch)
2005-01-06 15:48 UTC, Roger Leigh
none Details | Review

Description Roger Leigh 2005-01-06 15:47:03 UTC
glib/gwin32.c compiles with warnings due to a typecasting bug and a missing
header.  The attached patch corrects this.

Note: I'm not a Win32 programmer, and I can't confirm correctness of this patch,
other than conformance to the function prototype.
Comment 1 Roger Leigh 2005-01-06 15:48:03 UTC
Created attachment 35555 [details] [review]
Patch to correct compiler warning and missing header
Comment 2 Tor Lillqvist 2005-01-09 19:12:15 UTC
Is wchar.h really needed? At least in my mingw installation string.h has a
prototype for wcslen(), if that's what you think is missing, and just fixing the
cast gives a warning-free compile. (Re-open bug if it is needed for you.) The
cast is now fixed.
Comment 3 Roger Leigh 2005-01-09 21:31:59 UTC
wcslen is prototyped in <wchar.h>, not <string.h>.  That's according to the C99
Standard, Single UNIX Spec. v3, and the Linux manpage.  On Cygwin, <wchar.h> is
required to prototype wcslen, so IMO MinGW is buggy here.

This is taken from the ISO C99 draft I have:

#include <wchar.h>
size_t wcslen(const wchar_t *s);


Regards,
Roger
Comment 4 Tor Lillqvist 2005-01-09 22:56:29 UTC
Hmm, yes, mingw follows MSVC in having wcslen in string.h. And gwin32.c is built
also for Cygwin, didn't think of that. Added the wchar.h.