GNOME Bugzilla – Bug 785287
Program returns random data in a function (no-return-in-nonvoid-function)
Last modified: 2017-07-23 00:48:43 UTC
While building gnome-builder 3.25.5 - our post build checker complains about: [ 179s] ... testing for serious compiler warnings [ 179s] (using /usr/lib/build/checks-data/check_gcc_output) [ 179s] (using /var/tmp/build-root/Factory-x86_64/.build.log) [ 189s] [ 189s] I: Program returns random data in a function [ 189s] E: gnome-builder no-return-in-nonvoid-function ../contrib/gstyle/gstyle-color-plane.c:991 [ 189s] E: gnome-builder no-return-in-nonvoid-function ../plugins/color-picker/gb-color-picker-prefs.c:120 [ 189s] E: gnome-builder no-return-in-nonvoid-function ../plugins/xml-pack/ide-xml-rng-define.c:290 [ 189s] E: gnome-builder no-return-in-nonvoid-function ../plugins/xml-pack/ide-xml-tree-builder-utils.c:82
In each case provided here these are g_assert_not_reached() assertions. Which means that your checker too is either 1) not smart enough to understand abort assertions, or 2) you're compiling without assertions. In the case of 2, you almost certainly should not be doing that during odd-numbered minor releases as it would prevent us from getting good debugging information from users. I'm perfectly happy to add return NULL in these cases to silence the tooling in the mean time.
Created attachment 356214 [details] [review] use g_return_val_if_reached() over g_assert_not_reached() Not quite as ideal for us as the assertions, but gets the job done and lets external compiler tooling have a default value returned from the function.
Attachment 356214 [details] pushed as 4cead7b - use g_return_val_if_reached() over g_assert_not_reached()