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 785287 - Program returns random data in a function (no-return-in-nonvoid-function)
Program returns random data in a function (no-return-in-nonvoid-function)
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: general
3.25.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-07-22 22:40 UTC by Bjørn Lie
Modified: 2017-07-23 00:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
use g_return_val_if_reached() over g_assert_not_reached() (2.43 KB, patch)
2017-07-23 00:48 UTC, Christian Hergert
committed Details | Review

Description Bjørn Lie 2017-07-22 22:40:22 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
Comment 1 Christian Hergert 2017-07-23 00:43:13 UTC
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.
Comment 2 Christian Hergert 2017-07-23 00:48:19 UTC
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.
Comment 3 Christian Hergert 2017-07-23 00:48:41 UTC
Attachment 356214 [details] pushed as 4cead7b - use g_return_val_if_reached() over g_assert_not_reached()