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 310216 - glib-genmarshal uses GCC-specific extensions
glib-genmarshal uses GCC-specific extensions
Status: RESOLVED WONTFIX
Product: glib
Classification: Platform
Component: general
2.7.x
Other Linux
: Normal enhancement
: ---
Assigned To: gtkdev
gtkdev
Depends on: 310175
Blocks:
 
 
Reported: 2005-07-13 12:47 UTC by Priit Laes (IRC: plaes)
Modified: 2006-07-13 21:55 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Workaround for the warning (1.09 KB, patch)
2005-07-13 14:06 UTC, Priit Laes (IRC: plaes)
none Details | Review

Description Priit Laes (IRC: plaes) 2005-07-13 12:47:33 UTC
1. Create a marshalers.list file containing any kind of marshalers
2. Generate the source code using glib-genmarshal marshalers.list >test.c
3. Try to compile it using following gcc flags: '-Wall -pedantic -ansi -Werror'

It should return with an error: 
test.c: In function ‘g_cclosure_user_marshal_BOOLEAN__INT’:
test.c:80: warning: ISO C forbids conversion of object pointer to function
pointer type
Comment 1 Priit Laes (IRC: plaes) 2005-07-13 14:06:24 UTC
Created attachment 49091 [details] [review]
Workaround for the warning

One possible workaround to kill the warning.
Comment 2 Priit Laes (IRC: plaes) 2005-07-27 10:14:08 UTC
This is also present in CVS and related to the glib-2.0 flaw :(
Comment 3 Priit Laes (IRC: plaes) 2006-07-13 10:32:56 UTC
Fixing -ansi -pedantic issues may introduce new issues, so marking WONTFIX

13:27 <@neo> plaes: we accepted a patch lately in gimp that introduced a couple of changes to compile with -ansi -pedantic
13:28 <@neo> plaes: as a result compilitation broke on IRIX, Sun and probably other platforms
13:28 < plaes> ugh.. nice to know
13:29 < plaes> so -Wall should be enough?
13:29 <@yosh> OS X and FreeBSD too
13:29 <@neo> -Wall is definitely good practice
13:29 < jamesh> plaes: it is worth noting that that API isn't the only place where GTK makes assumptions that are not guaranteed
                by the ISO standard
13:29 < jamesh> (but can be relied on for all platforms people care about)
Comment 4 Behdad Esfahbod 2006-07-13 16:17:09 UTC
Another hack I found to fix this warning is to use a union of a pointer and a function pointer.  Assign to one, read from the other.
Comment 5 Manish Singh 2006-07-13 21:55:16 UTC
IIRC, that is also not allowed by the C standard (though gcc supports it).