Bug#811778: din: FTBFS with GCC 6: narrowing conversion

2016-09-01 Thread Philip Chung
Control: tags -1 patch

On Tue, 19 Jan 2016 17:58:59 -0800 Martin Michlmayr  wrote:
> Package: din
> Version: 5.2.1-3
> Severity: important
> User: debian-...@lists.debian.org
> Usertags: ftbfs-gcc-6 gcc-6-narrowing
> 
> This package fails to build with GCC 6.  GCC 6 has not been released
> yet, but it's expected that GCC 6 will become the default compiler for
> stretch.

Attached is a patch to fix the errors. The package now builds on my
amd64 system.

The patch redefines some constants in include/random.h as unsigned, for
consistency with the variables they are used with. (Though, strictly
speaking, only MATRIX_A needs to be redefined for the package to build.)

Philip Chung
Description: Redefine some constants in include/random.h as unsigned
 These constants are used with unsigned variables, so redefine them
 for consistency.
 .
 This also fixes compilation errors under C++11: In C++11, array initialization
 is considered list initialization and so prohibits narrowing conversions
 (from negative signed values to unsigned).
Author: Philip Chung 
Bug-Debian: https://bugs.debian.org/811778
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---
 include/random.h |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- din-5.2.1.orig/include/random.h
+++ din-5.2.1/include/random.h
@@ -28,9 +28,9 @@
 
 const int N = 624;
 const int M = 397;
-const int MATRIX_A = 0x9908b0df; /* constant vector a */
-const int UPPER_MASK = 0x8000; /* most significant w-r bits */
-const int LOWER_MASK = 0x7fff; /* least significant r bits */
+const unsigned int MATRIX_A = 0x9908b0df; /* constant vector a */
+const unsigned int UPPER_MASK = 0x8000; /* most significant w-r bits */
+const unsigned int LOWER_MASK = 0x7fff; /* least significant r bits */
 
 static unsigned int mt[N]; /* the array for the state vector  */
 static int mti=N+1; /* mti==N+1 means mt[N] is not initialized */
___
pkg-multimedia-maintainers mailing list
pkg-multimedia-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-multimedia-maintainers

Bug#811778: din: FTBFS with GCC 6: narrowing conversion

2016-01-19 Thread Martin Michlmayr
Package: din
Version: 5.2.1-3
Severity: important
User: debian-...@lists.debian.org
Usertags: ftbfs-gcc-6 gcc-6-narrowing

This package fails to build with GCC 6.  GCC 6 has not been released
yet, but it's expected that GCC 6 will become the default compiler for
stretch.

Note that only the first error is reported; there might be more.  You
can find a snapshot of GCC 6 in experimental.  To build with GCC 6,
you can set CC=gcc-6 CXX=g++-6 explicitly.

You may be able to find out more about this issue at
https://gcc.gnu.org/gcc-6/changes.html

> sbuild (Debian sbuild) 0.67.0 (26 Dec 2015) on dl580gen9-02.hlinux
...
> g++ -DPACKAGE_NAME=\"din\" -DPACKAGE_TARNAME=\"din\" 
> -DPACKAGE_VERSION=\"5.2.1\" -DPACKAGE_STRING=\"din\ 5.2.1\" 
> -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"din\" 
> -DVERSION=\"5.2.1\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 
> -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 
> -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_GL_GL_H=1 
> -DHAVE_TCL8_5_TCL_H=1 -DHAVE_LIBIRCCLIENT_H=1 -I.   -Wdate-time 
> -D_FORTIFY_SOURCE=2-I /usr/include -I /usr/local/include -I /opt/include 
> -I/usr/include/tcl8.5 -I/usr/local/include/tcl8.5 -I /opt/include/tcl8.5 -I 
> ../include  -Wall -O3 -g -O2 -fstack-protector-strong -Wformat 
> -Werror=format-security -c -o levels.o levels.cc
> In file included from ../include/color.h:25:0,
>  from curve.cc:24:
> ../include/random.h: In function 'unsigned int get_rand_32()':
> ../include/random.h:57:48: error: narrowing conversion of '-1727483681' from 
> 'int' to 'unsigned int' inside { } [-Wnarrowing]
>  static unsigned int mag01[2]={0x0, MATRIX_A};
> ^
> 
> Makefile:485: recipe for target 'curve.o' failed
> make[3]: *** [curve.o] Error 1
> make[3]: *** Waiting for unfinished jobs
> In file included from ../include/color.h:25:0,
>  from ../include/console.h:31,
>  from help.cc:23:
> ../include/random.h: In function 'unsigned int get_rand_32()':
> ../include/random.h:57:48: error: narrowing conversion of '-1727483681' from 
> 'int' to 'unsigned int' inside { } [-Wnarrowing]
>  static unsigned int mag01[2]={0x0, MATRIX_A};
> ^
> 
> In file included from ../include/color.h:25:0,
>  from ../include/console.h:31,
>  from console.cc:22:
> ../include/random.h: In function 'unsigned int get_rand_32()':
> ../include/random.h:57:48: error: narrowing conversion of '-1727483681' from 
> 'int' to 'unsigned int' inside { } [-Wnarrowing]
>  static unsigned int mag01[2]={0x0, MATRIX_A};
> ^
> 
> In file included from ../include/color.h:25:0,
>  from ../include/range.h:26,
>  from range.cc:21:
> ../include/random.h: In function 'unsigned int get_rand_32()':
> ../include/random.h:57:48: error: narrowing conversion of '-1727483681' from 
> 'int' to 'unsigned int' inside { } [-Wnarrowing]
>  static unsigned int mag01[2]={0x0, MATRIX_A};
> ^
> 
> In file included from ../include/color.h:25:0,
>  from ../include/console.h:31,
>  from viewwin.cc:23:
> ../include/random.h: In function 'unsigned int get_rand_32()':
> ../include/random.h:57:48: error: narrowing conversion of '-1727483681' from 
> 'int' to 'unsigned int' inside { } [-Wnarrowing]
>  static unsigned int mag01[2]={0x0, MATRIX_A};
> ^
> 
> In file included from ../include/color.h:25:0,
>  from ../include/console.h:31,
>  from ../include/console_iterator.h:24,
>  from console_iterator.cc:21:
> ../include/random.h: In function 'unsigned int get_rand_32()':
> ../include/random.h:57:48: error: narrowing conversion of '-1727483681' from 
> 'int' to 'unsigned int' inside { } [-Wnarrowing]
>  static unsigned int mag01[2]={0x0, MATRIX_A};
> ^
> 
> In file included from ../include/color.h:25:0,
>  from ../include/console.h:31,
>  from beat2value.cc:22:
> ../include/random.h: In function 'unsigned int get_rand_32()':
> ../include/random.h:57:48: error: narrowing conversion of '-1727483681' from 
> 'int' to 'unsigned int' inside { } [-Wnarrowing]
>  static unsigned int mag01[2]={0x0, MATRIX_A};
> ^
> 
> In file included from solver.cc:24:0:
> ../include/random.h: In function 'unsigned int get_rand_32()':
> ../include/random.h:57:48: error: narrowing conversion of '-1727483681' from 
> 'int' to 'unsigned int' inside { } [-Wnarrowing]
>  static unsigned int mag01[2]={0x0, MATRIX_A};
> ^
> 
> In file included from