lol

audiofile: Fix build on GCC 6

http://hydra.nixos.org/build/42228674

authored by

Eelco Dolstra and committed by
Robin Gloster
d01d2db3 17a344a5

+31 -1
+1 -1
pkgs/development/libraries/audiofile/default.nix
··· 13 13 sha256 = "0rb927zknk9kmhprd8rdr4azql4gn2dp75a36iazx2xhkbqhvind"; 14 14 }; 15 15 16 - patches = [ ./CVE-2015-7747.patch ]; 16 + patches = [ ./CVE-2015-7747.patch ./gcc-6.patch ]; 17 17 18 18 meta = with stdenv.lib; { 19 19 description = "Library for reading and writing audio files in various formats";
+30
pkgs/development/libraries/audiofile/gcc-6.patch
··· 1 + http://patchwork.ozlabs.org/patch/630200/ 2 + 3 + From 28cfdbbcb96a69087c3d21faf69b5eae7bcf6d69 Mon Sep 17 00:00:00 2001 4 + From: Hodorgasm <nsane457@gmail.com> 5 + Date: Wed, 11 May 2016 21:42:07 -0400 6 + Subject: [PATCH] Cast to unsigned while left bit-shifting 7 + 8 + GCC-6 now treats the left bitwise-shift of a negative integer as nonconformant so explicitly cast to an unsigned int while bit-shifting. 9 + 10 + Downloaded from upstream PR: 11 + https://github.com/mpruett/audiofile/pull/28 12 + 13 + Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de> 14 + --- 15 + libaudiofile/modules/SimpleModule.h | 2 +- 16 + 1 file changed, 1 insertion(+), 1 deletion(-) 17 + 18 + diff --git a/libaudiofile/modules/SimpleModule.h b/libaudiofile/modules/SimpleModule.h 19 + index 03c6c69..4014fb2 100644 20 + --- a/libaudiofile/modules/SimpleModule.h 21 + +++ b/libaudiofile/modules/SimpleModule.h 22 + @@ -123,7 +123,7 @@ struct signConverter 23 + typedef typename IntTypes<Format>::UnsignedType UnsignedType; 24 + 25 + static const int kScaleBits = (Format + 1) * CHAR_BIT - 1; 26 + - static const int kMinSignedValue = -1 << kScaleBits; 27 + + static const int kMinSignedValue = static_cast<signed>(static_cast<unsigned>(-1) << kScaleBits);; 28 + 29 + struct signedToUnsigned : public std::unary_function<SignedType, UnsignedType> 30 + {