GNOME Bugzilla – Bug 753381
Return value problem in gom_sorting_add
Last modified: 2015-08-12 10:35:59 UTC
Please see the patch. It fixes a return error in gom_sorting_add.
Created attachment 308937 [details] [review] gom: Fix return value error in gom_sorting_add
Right, so this is about -Wreturn-type: the void function should not return any value, but we return NULL. It seems GCC has some special casing for this, as it doesn't complain at all about returning NULL in a void function, even when enabling the warning. However, clang errors out on this, which means Gom can't be built with clang. The patch is trivial and obvious, so a +1 from me. (but I'm not a maintainer, so wait for one of them to ACK the patch before pushing it)
Comment on attachment 308937 [details] [review] gom: Fix return value error in gom_sorting_add LGTM
I forgot, to reproduce the problem: $ export CC=clang $ ./autogen.sh $ make Ting-Wei, it would have been nice if you had explained how to reproduce the problem in details, like I did above and in the previous comment. :)
Attachment 308937 [details] pushed as d9362b1 - gom: Fix return value error in gom_sorting_add
(In reply to Mathieu Bridon from comment #2) > Right, so this is about -Wreturn-type: the void function should not return > any value, but we return NULL. > > It seems GCC has some special casing for this, as it doesn't complain at all > about returning NULL in a void function, even when enabling the warning. > This is a GLib problem reported here: https://bugzilla.gnome.org/show_bug.cgi?id=753310 gmessages.h contains '#pragma GCC system_header', so warnings are ignored by GCC. (In reply to Mathieu Bridon from comment #4) > I forgot, to reproduce the problem: > > $ export CC=clang > $ ./autogen.sh > $ make > > Ting-Wei, it would have been nice if you had explained how to reproduce the > problem in details, like I did above and in the previous comment. :) I have a JHBuild tinderbox running on FreeBSD: https://wiki.gnome.org/Projects/Jhbuild/FreeBSD FreeBSD >= 10 uses clang as the system compiler, so it is easy to catch clang build issue on it. If you search for 'void' on the wiki page, you can find that return value error is the most common problem when building GNOME modules on FreeBSD. The JHBuild tinderbox automatically starts a build job at 3 am everyday. This helps us to catch build issues before releases are made, so packaging can be much easier because most bugs are fixed before releases.