GNOME Bugzilla – Bug 310216
glib-genmarshal uses GCC-specific extensions
Last modified: 2006-07-13 21:55:16 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
Created attachment 49091 [details] [review] Workaround for the warning One possible workaround to kill the warning.
This is also present in CVS and related to the glib-2.0 flaw :(
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)
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.
IIRC, that is also not allowed by the C standard (though gcc supports it).