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 760134 - audioconvert test: doesn't build with clang
audioconvert test: doesn't build with clang
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other FreeBSD
: Normal normal
: 1.7.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-01-04 22:03 UTC by Koop Mast (kwm)
Modified: 2016-01-06 01:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch with suggested build fix (3.12 KB, patch)
2016-01-05 20:09 UTC, Koop Mast (kwm)
needs-work Details | Review

Description Koop Mast (kwm) 2016-01-04 22:03:55 UTC
The elements/audioconvert test doesn't build with clang 3.7.1.


  CC       elements/elements_audioconvert-audioconvert.o
elements/audioconvert.c:650:12: error: shifting a negative signed value is
      undefined [-Werror,-Wshift-negative-value]
      (-32 << 16) + (1 << 15), (-32 << 16) - (1 << 15),
       ~~~ ^
elements/audioconvert.c:650:37: error: shifting a negative signed value is
      undefined [-Werror,-Wshift-negative-value]
      (-32 << 16) + (1 << 15), (-32 << 16) - (1 << 15),
                                ~~~ ^
elements/audioconvert.c:651:12: error: shifting a negative signed value is
      undefined [-Werror,-Wshift-negative-value]
      (-32 << 16) + (2 << 15), (-32 << 16) - (2 << 15),
       ~~~ ^
elements/audioconvert.c:651:37: error: shifting a negative signed value is
      undefined [-Werror,-Wshift-negative-value]
      (-32 << 16) + (2 << 15), (-32 << 16) - (2 << 15),
                                ~~~ ^
elements/audioconvert.c:652:12: error: shifting a negative signed value is
      undefined [-Werror,-Wshift-negative-value]
      (-32 << 16)
       ~~~ ^
elements/audioconvert.c:673:12: error: shifting a negative signed value is
      undefined [-Werror,-Wshift-negative-value]
      (-32 << 16) + (1 << 15), (-32 << 16) - (1 << 15),
       ~~~ ^
elements/audioconvert.c:673:37: error: shifting a negative signed value is
      undefined [-Werror,-Wshift-negative-value]
      (-32 << 16) + (1 << 15), (-32 << 16) - (1 << 15),
                                ~~~ ^
elements/audioconvert.c:674:12: error: shifting a negative signed value is
      undefined [-Werror,-Wshift-negative-value]
      (-32 << 16) + (2 << 15), (-32 << 16) - (2 << 15),
       ~~~ ^
elements/audioconvert.c:674:37: error: shifting a negative signed value is
      undefined [-Werror,-Wshift-negative-value]
      (-32 << 16) + (2 << 15), (-32 << 16) - (2 << 15),
                                ~~~ ^
elements/audioconvert.c:675:12: error: shifting a negative signed value is
      undefined [-Werror,-Wshift-negative-value]
      (-32 << 16)
       ~~~ ^
elements/audioconvert.c:815:26: error: shifting a negative signed value is
      undefined [-Werror,-Wshift-negative-value]
      (gdouble) (-32768L << 16) / 2147483648.0, /* ~ -1.0 */
                 ~~~~~~~ ^
elements/audioconvert.c:817:26: error: shifting a negative signed value is
      undefined [-Werror,-Wshift-negative-value]
      (gdouble) (-16384L << 16) / 2147483648.0, /* ~ -0.5 */
                 ~~~~~~~ ^
elements/audioconvert.c:825:29: error: shifting a negative signed value is
      undefined [-Werror,-Wshift-negative-value]
    gint32 in[] = { 0, (-1L << 31), (1L << 30), (-1L << 30) };
                        ~~~ ^
elements/audioconvert.c:825:54: error: shifting a negative signed value is
      undefined [-Werror,-Wshift-negative-value]
    gint32 in[] = { 0, (-1L << 31), (1L << 30), (-1L << 30) };
                                                 ~~~ ^
elements/audioconvert.c:827:22: error: shifting a negative signed value is
      undefined [-Werror,-Wshift-negative-value]
      (gdouble) (-1L << 31) / 2147483648.0,     /* ~ -1.0 */
                 ~~~ ^
elements/audioconvert.c:829:22: error: shifting a negative signed value is
      undefined [-Werror,-Wshift-negative-value]
      (gdouble) (-1L << 30) / 2147483648.0,     /* ~ -0.5 */
                 ~~~ ^
elements/audioconvert.c:1070:12: error: shifting a negative signed value is
      undefined [-Werror,-Wshift-negative-value]
      (-32 << 16) + (1 << 15), (-32 << 16) - (1 << 15),
       ~~~ ^
elements/audioconvert.c:1070:37: error: shifting a negative signed value is
      undefined [-Werror,-Wshift-negative-value]
      (-32 << 16) + (1 << 15), (-32 << 16) - (1 << 15),
                                ~~~ ^
elements/audioconvert.c:1071:12: error: shifting a negative signed value is
      undefined [-Werror,-Wshift-negative-value]
      (-32 << 16) + (2 << 15), (-32 << 16) - (2 << 15),
       ~~~ ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
Makefile:2519: recipe for target 'elements/elements_audioconvert-audioconvert.o' failed
Comment 1 Sebastian Dröge (slomo) 2016-01-05 08:48:04 UTC
Does changing it from "(-32 << 16)" to "(-(32 << 16))" fix the warnings? That's the intention of the code at least.
Comment 2 Koop Mast (kwm) 2016-01-05 20:09:51 UTC
Created attachment 318288 [details] [review]
patch with suggested build fix

This patch with the suggested change fixes the build with clang.

Sorry no git format-patch, the ident git pre-commit hook was giving me a truck load of ident changes too.
Comment 3 Nicolas Dufresne (ndufresne) 2016-01-05 21:07:09 UTC
Review of attachment 318288 [details] [review]:

Please re-submit using git format-path. If you believe the indent is appropriate, you can use git commit -n to skip the checks. Please mention this though while submitting, so we can have a closer look.
Comment 4 Tim-Philipp Müller 2016-01-06 01:16:44 UTC
commit 17b16e7a8350db7d83cc94093b81c4240850140d
Author: Koop Mast <kwm@FreeBSD.org>
Date:   Wed Jan 6 01:04:31 2016 +0000

    tests: audioconvert: fix test compilation with clang
    
    With clang 3.7.1 on FreeBSD:
    elements/audioconvert.c:650:12: error: shifting a negative signed value is
          undefined [-Werror,-Wshift-negative-value]
          (-32 << 16) + (1 << 15), (-32 << 16) - (1 << 15),
           ~~~ ^
    
    https://bugzilla.gnome.org/show_bug.cgi?id=760134

commit e5fb7275c28256974cf71f4dd51a22df61e62f9e
Author: Tim-Philipp Müller <tim@centricular.com>
Date:   Wed Jan 6 01:06:10 2016 +0000ommit 17b16e7a8350db7d83cc94093b81c4240850140d
Author: Koop Mast <kwm@FreeBSD.org>
Date:   Wed Jan 6 01:04:31 2016 +0000

    tests: audioconvert: fix test compilation with clang
    
    With clang 3.7.1 on FreeBSD:
    elements/audioconvert.c:650:12: error: shifting a negative signed value is
          undefined [-Werror,-Wshift-negative-value]
          (-32 << 16) + (1 << 15), (-32 << 16) - (1 << 15),
           ~~~ ^
    
    https://bugzilla.gnome.org/show_bug.cgi?id=760134

commit e5fb7275c28256974cf71f4dd51a22df61e62f9e
Author: Tim-Philipp Müller <tim@centricular.com>
Date:   Wed Jan 6 01:06:10 2016 +0000

    tests: fix indentation of various unit tests


    tests: fix indentation of various unit tests