win32 warning - g_win32_get_system_data_dirs



I have just added Win32 GTK development to my existing Linux development experience, and I am getting a warning when using GTK 2.14.7 and MinGW:

C:/msys/1.0/include/glib-2.0/glib/gutils.h: In function `g_win32_get_system_data_dirs': C:/msys/1.0/include/glib-2.0/glib/gutils.h:143: warning: ISO C forbids conversion of function pointer to object pointer type

Bug that caused this: http://bugzilla.gnome.org/show_bug.cgi?id=173098

My ugly patch:

--- /include/glib-2.0/glib/gutils.h.orig        2009-01-13 11:04:38 -0600
+++ /include/glib-2.0/glib/gutils.h     2009-02-03 16:56:29 -0600
@@ -140,7 +140,11 @@
 static inline G_CONST_RETURN gchar * G_CONST_RETURN *
 g_win32_get_system_data_dirs (void)
 {
- return g_win32_get_system_data_dirs_for_module ((gconstpointer) &g_win32_get_system_data_dirs);
+  gconstpointer address;
+  G_CONST_RETURN gchar * G_CONST_RETURN * pfn;
+
+  *(unsigned long *) &address = *(unsigned long *) &pfn;
+  return g_win32_get_system_data_dirs_for_module (address);
 }
 #define g_get_system_data_dirs g_win32_get_system_data_dirs
 #endif

It probably needs work, but this removes the warning and should keep the same functionality. Anyone have any recommendations: File a new bug? Open the old bug?



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