Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 582792

Summary: media-libs/audiofile-0.3.6-r1: building w/gcc-6: error: left operand of shift expression '(-1 << 7)' is negative [-fpermissive]
Product: Gentoo Linux Reporter: Peter Levine <plevine457>
Component: Current packagesAssignee: Gentoo Linux Gnome Desktop Team <gnome>
Status: RESOLVED FIXED    
Severity: normal CC: dracwyrm, fturco, sound
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 582084    
Attachments: Add -fpermissive to CXXFLAGS to avoid errors with gcc-v6
audiofile-0.3.6-gcc6-build-fixes.patch

Description Peter Levine 2016-05-12 02:28:58 UTC
Left bitwise-shifting of a negative integer type is now nonconformant with gcc-6.

I made an upstream pull request pending approval:

https://github.com/mpruett/audiofile/pull/28
Comment 1 Roman Beránek 2016-05-22 15:02:44 UTC
Created attachment 434972 [details, diff]
Add -fpermissive to CXXFLAGS to avoid errors with gcc-v6
Comment 2 Roman Beránek 2016-05-22 15:04:01 UTC
What about adding the '-fpermissive' flag as the gcc itself suggest?
Comment 3 Roman Beránek 2016-05-22 15:05:38 UTC
Comment on attachment 434972 [details, diff]
Add -fpermissive to CXXFLAGS to avoid errors with gcc-v6

What about adding the '-fpermissive' flag as the gcc itself suggest?
Comment 4 Roman Beránek 2016-05-22 15:07:35 UTC
(I'm sorry for the mess, this is my first time using bugzilla, didn't know you can't edit nor delete a comment.)
Comment 5 Peter Levine 2016-05-23 16:07:00 UTC
C++14 dialect forces the programmer to explicitly declare his/her intent to code something potentially dangerous that might have been assumed to be fine in C++98 dialect.  You can add -fpermissive and/or -std=c++98 flag to overcome most gcc-6 related errors but it's really a bandaid over the problem.  Though some upstream developers have chosen this route, IMHO it should be avoided if possible and a dialect neutral solution should be preferred.
Comment 6 Francesco Turco 2016-08-31 13:39:12 UTC
I confirm adding -fpermissive to CXXFLAGS "fixes" the problem.
Comment 7 Jonathan Scruggs (RETIRED) gentoo-dev 2016-10-27 16:41:36 UTC
Created attachment 451648 [details, diff]
audiofile-0.3.6-gcc6-build-fixes.patch

Adding the compiler flag does not fix the underlying issues.

Please find attached the proper patch that fixes the issues. It's compatible with all versions of GCC officially in portage now. :)

To use this:
Save the attached patch with the description name.
Place it in /etc/portage/patches/media-libs/audiofile/
The ebuild does not need to be modified as it will pick up this patch and apply it.

Cheers.
Comment 8 David Seifert gentoo-dev 2016-10-28 22:38:40 UTC
commit db5ba8d0625e670e679f558e0943006f238f952b
Author: Jonathan Scruggs <j.scruggs@gmail.com>
Date:   Fri Oct 28 10:31:09 2016 +0100

    media-libs/audiofile: Add gcc 6 build fixes patch
    
    Gentoo-bug: 582792
    
    Signed-off by: Jonathan Scruggs (j.scruggs@gmail.com)
    Closes: https://github.com/gentoo/gentoo/pull/2684
    
    Signed-off-by: David Seifert <soap@gentoo.org>