Re: openCOLLADA: Help with GCC6 narrowing conversion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Richard Shaw wrote on 02/15/2016 11:34 PM:
Can someone point me in the right direction? My package openCOLLADA is
FTBFS in rawhide with the following (repeating) error:

/builddir/build/BUILD/OpenCOLLADA-3335ac164e68b2512a40914b14c74db260e6ff7d/COLLADABaseUtils/src/COLLADABUURI.cpp:57:2:
error: narrowing conversion of '-1' from 'int' to 'char' inside { }
[-Wnarrowing]
   };

I tried using the gcc6 porting guide but I'm not qutie enough of a
programmer to understand how to apply it in this case. The offending code
is:

         const char HEX2DEC[256] = ^M
         {^M
                 /*       0  1  2  3   4  5  6  7   8  9  A  B   C  D  E  F
*/^M
                 /* 0 */ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
-1,-1,-1,-1,^M
                 /* 1 */ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,

<snip>

On _ARM_ (actually build failure seems to be on ARM) char is _unsigned_
by default, so converting (int)-1 to char on ARM is narrowing conversion
and C++11 forbids this on list-initialization.

You can do this when you explicitly cast, like
 const char HEX2DEC[256] = { (char)-1, ..... }

Regards,
Mamoru

--
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
http://lists.fedoraproject.org/admin/lists/devel@xxxxxxxxxxxxxxxxxxxxxxx




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux