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 767998 - tautological-compare warnings/errors when building tests with recent GCC
tautological-compare warnings/errors when building tests with recent GCC
Status: RESOLVED DUPLICATE of bug 764526
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-06-24 09:42 UTC by Guillaume Desmottes
Modified: 2016-07-04 14:21 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Guillaume Desmottes 2016-06-24 09:42:35 UTC
I updated to Fedora 24 (gcc 6.1.1) and get those warnings (handled as errors) when running "make check".

gst/gstinfo.c: In function ‘info_ptr_format_printf_extension’:
gst/gstinfo.c:59:26: error: self-comparison always evaluates to true [-Werror=tautological-compare]
   gst_debug_remove_log_function (gst_debug_log_default);
                          ^~
gst/gstinfo.c:134:33: error: self-comparison always evaluates to true [-Werror=tautological-compare]
   gst_debug_add_log_function (gst_debug_log_default, NULL, NULL);
                                 ^~
gst/gstinfo.c: In function ‘info_segment_format_printf_extension’:
gst/gstinfo.c:145:26: error: self-comparison always evaluates to true [-Werror=tautological-compare]
   gst_debug_remove_log_function (gst_debug_log_default);
                          ^~
gst/gstinfo.c:212:33: error: self-comparison always evaluates to true [-Werror=tautological-compare]
   gst_debug_add_log_function (gst_debug_log_default, NULL, NULL);
                                 ^~
gst/gstinfo.c: In function ‘info_log_handler’:
gst/gstinfo.c:222:36: error: self-comparison always evaluates to true [-Werror=tautological-compare]
   removed = gst_debug_remove_log_function (gst_debug_log_default);
                                    ^~
gst/gstinfo.c: In function ‘info_old_printf_extensions’:
gst/gstinfo.c:292:26: error: self-comparison always evaluates to true [-Werror=tautological-compare]
   gst_debug_remove_log_function (gst_debug_log_default);
                          ^~
gst/gstinfo.c:327:33: error: self-comparison always evaluates to true [-Werror=tautological-compare]
   gst_debug_add_log_function (gst_debug_log_default, NULL, NULL);
                                 ^~
cc1: all warnings being treated as errors
Makefile:2469: recipe for target 'gst/gstinfo.o' failed
Comment 1 Guillaume Desmottes 2016-06-24 10:44:54 UTC
Looks like it's because of this: https://cgit.freedesktop.org/gstreamer/gstreamer/tree/gst/gstinfo.h#n427

#define gst_debug_remove_log_function(func)   \
    (func == gst_debug_log_default) ?         \
        gst_debug_remove_log_function(NULL) : \
        gst_debug_remove_log_function(func)

What's the point of this macro exactly? We have the same the same logic implemented in the function:

  if (func == NULL)
    func = gst_debug_log_default;
Comment 2 Guillaume Desmottes 2016-07-04 14:16:07 UTC

*** This bug has been marked as a duplicate of bug 764526 ***
Comment 3 Jan Schmidt 2016-07-04 14:21:27 UTC
I didn't see this bug until now. To answer your question in comment 1, it's to do with the fact that we can't compare the function pointer directly inside the function, because the function pointer GStreamer sees internally can be different to value of the globally available function entry point and they don't match. See the commits where the macro was added.