Bug#811682: FTBFS with GCC 6: could not convert a from x to y

2016-06-26 Thread Gert Wollny
Are you sure?
> It fails to build from source in unstable.
> 
> View.cc: In member function 'SmartPtr View::getCharAt(const
> scaled&, const scaled&, CharIndex&, Point*, BoundingBox*) const':
> View.cc:294:10: error: 'nullptr' was not declared in this scope
>    return nullptr;

Arrg, "nullptr" is a c++11 construct, and since g++-5  defaults to
c++03, it doesn't compile like this.

Instead 

   return SmartPtr(); 

should work in both cases (if this SmartPtr template defines a sensible
default constructor). Otherwise "return NULL" should be the (ugly)
solution.

Best, 
Gert



Bug#811682: FTBFS with GCC 6: could not convert a from x to y

2016-06-26 Thread Sylvestre Ledru
Le 26/06/2016 à 14:27, Gert Wollny a écrit :
> Control: tags -1 patch 
>
> Hello, 
>
> the attached patch fixes the reported compile error and also fixes the
> "narrowing conversion" errors that came up with g++-6.
>
> The package now builds with g++-6 (but it is not lintian-clean). 
>
> Best, 
> Gert 
Hello,

Are you sure?
It fails to build from source in unstable.

View.cc: In member function 'SmartPtr View::getCharAt(const
scaled&, const scaled&, CharIndex&, Point*, BoundingBox*) const':
View.cc:294:10: error: 'nullptr' was not declared in this scope
   return nullptr;

Thanks

S



Bug#811682: FTBFS with GCC 6: could not convert a from x to y

2016-06-26 Thread Gert Wollny
Control: tags -1 patch 

Hello, 

the attached patch fixes the reported compile error and also fixes the
"narrowing conversion" errors that came up with g++-6.

The package now builds with g++-6 (but it is not lintian-clean). 

Best, 
Gert 
From: Gert Wollny 
Date: Sun, 26 Jun 2016 13:25:00 +0200
Description: gcc 6.0 build fixes
Bug: https://bugs.debian.org/811682

--- a/src/engine/common/View.cc
+++ b/src/engine/common/View.cc
@@ -291,7 +291,7 @@
 	  }
 }
 
-  return false;
+  return nullptr;
 }
 
 bool
--- a/src/backend/common/tfm/TFM.hh
+++ b/src/backend/common/tfm/TFM.hh
@@ -37,7 +37,7 @@
 unsigned char face;
 const char* codingScheme;
 int designSize;
-int checksum;
+unsigned int checksum;
 unsigned int nDimensions;
 unsigned int nCharacters;
   };
@@ -52,7 +52,7 @@
   struct Kerning
   {
 UChar8 index;
-int value;
+unsigned int value;
   };
 
   struct Ligature
@@ -67,7 +67,7 @@
 UChar8 index;
 int width;
 int height;
-int depth;
+unsigned int depth;
 int italicCorrection;
 unsigned char nKernings;
 const Kerning* kerning;
--- a/src/backend/common/ComputerModernShaper.cc
+++ b/src/backend/common/ComputerModernShaper.cc
@@ -578,7 +578,7 @@
   };
 #endif
 
-static ComputerModernShaper::PlainChar cmsMap[] =
+static ComputerModernShaper::PlainChar32 cmsMap[] =
   {
 { 0x007B, 0x66 },  // LEFT CURLY BRACKET
 { 0x007D, 0x67 },  // RIGHT CURLY BRACKET
--- a/src/backend/common/StandardSymbolsShaper.hh
+++ b/src/backend/common/StandardSymbolsShaper.hh
@@ -32,20 +32,20 @@
   struct HStretchyChar
   {
 Char16 ch;
-Char8 normal;
-Char8 left;
-Char8 glue;
-Char8 right;
+UChar8 normal;
+UChar8 left;
+UChar8 glue;
+UChar8 right;
   };
   
   struct VStretchyChar
   {
 Char16 ch;
-Char8 normal;
-Char8 top;
-Char8 glue;
-Char8 middle;
-Char8 bottom;
+UChar8 normal;
+UChar8 top;
+UChar8 glue;
+UChar8 middle;
+UChar8 bottom;
   };
 
 protected:
--- a/src/backend/common/StandardSymbolsShaper.cc
+++ b/src/backend/common/StandardSymbolsShaper.cc
@@ -29,7 +29,7 @@
 #include "ShapingContext.hh"
 
 struct GlyphMap {
-  Char8 index;
+  UChar8 index;
   Char16 ch;
 };
 


Bug#811682: FTBFS with GCC 6: could not convert a from x to y

2016-01-19 Thread Martin Michlmayr
Package: gtkmathview
Version: 0.8.0-13
Severity: important
User: debian-...@lists.debian.org
Usertags: ftbfs-gcc-6 gcc-6-cannot-convert

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.

> sbuild (Debian sbuild) 0.67.0 (26 Dec 2015) on dl580gen9-02.hlinux
...
> libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../../auto 
> -I../../../src/common -I../../../src/common/mathvariants 
> -I../../../src/engine/common -I../../../src/engine/mathml 
> -I../../../src/engine/boxml -I../../../src/frontend/common 
> -I../../../src/backend/common -DGMV_MathView_DLL -Wdate-time 
> -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat 
> -Werror=format-security -Wall -W -Wall -c View.cc  -fPIC -DPIC -o 
> .libs/libengine_common_la-View.o
> In file included from /usr/include/c++/6/ext/hash_map:60:0,
>  from ../../../src/common/HashMap.hh:24,
>  from 
> ../../../src/engine/mathml/MathMLOperatorDictionary.hh:25,
>  from View.cc:29:
> /usr/include/c++/6/backward/backward_warning.h:32:2: warning: #warning This 
> file includes at least one deprecated or antiquated header which may be 
> removed without further notice at a future date. Please use a non-deprecated 
> interface with equivalent functionality instead. For a listing of replacement 
> headers and interfaces, consult the file backward_warning.h. To disable this 
> warning use -Wno-deprecated. [-Wcpp]
>  #warning \
>   ^~~
> 
> View.cc: In member function 'SmartPtr View::getCharAt(const scaled&, 
> const scaled&, CharIndex&, Point*, BoundingBox*) const':
> View.cc:294:10: error: could not convert 'false' from 'bool' to 
> 'SmartPtr'
>return false;
>   ^
> 
> Makefile:579: recipe for target 'libengine_common_la-View.lo' failed
> make[5]: *** [libengine_common_la-View.lo] Error 1

-- 
Martin Michlmayr
Linux for HPE Helion, Hewlett Packard Enterprise