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 656264 - tag: no-return-in-nonvoid-function compiler warning gstxmptag.c:178
tag: no-return-in-nonvoid-function compiler warning gstxmptag.c:178
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: 0.11.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-08-10 09:51 UTC by Dominique Leuenberger
Modified: 2011-08-10 10:28 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Dominique Leuenberger 2011-08-10 09:51:16 UTC
While building gstreamer 0.11.0 on the Open Build Service (*target openSUSE Factory/12.1), The build aborts with:

I: Program returns random data in a function
E: gstreamer-plugins-base no-return-in-nonvoid-function gstxmptag.c:178

The raised compiler warning from the build log is:
gstxmptag.c: In function 'xmp_tag_type_get_name':
gstxmptag.c:178:1: warning: control reaches end of non-void function [-Wreturn-type]

The code fragment in question:
static const gchar *
xmp_tag_type_get_name (GstXmpTagType tagtype)
{
  switch (tagtype) {
    case GstXmpTagTypeSeq:
      return "rdf:Seq";
    case GstXmpTagTypeBag:
      return "rdf:Bag";
    default:
      g_assert_not_reached ();
  }
}

==> Thus: the 'default' path does not have a return value for the function. I assume returning NULL might be safe/sufficient?
Comment 1 Tim-Philipp Müller 2011-08-10 10:10:26 UTC
I fixed this yesterday actually, but failed to push the fix:

 commit 2d1ffa68a9970e3f67233bfbeeb5baf1ed913b53
 Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
 Date:   Tue Aug 9 16:41:01 2011 +0100

    xmptag: fix compiler warning in release mode
    
    Fix compiler warning caused by g_assert_not_reached() being skipped
    because releases are compiled with -DG_DISABLE_ASSERT.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=656264


It shouldn't abort the build though, our release tarballs shouldn't be using -Werror (unless OBS makes it stop on compiler warnings),
Comment 2 Dominique Leuenberger 2011-08-10 10:28:24 UTC
The build itself does pass, but there is a BRP (Build Root Policy) check flagging packages based on this.