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

Bug 592442

Summary: x11-libs/wxGTK- building w/gcc-6: error: narrowing conversion of '128' from 'int' to 'char' inside { } [-Wnarrowing]
Product: Gentoo Linux Reporter: Francesco Turco <mail>
Component: Current packagesAssignee: Gentoo wxWidgets Herd <wxwidgets>
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 582084    
Attachments: emerge --info
build log for wxGTK- using gcc-6.2.0

Description Francesco Turco 2016-08-30 15:45:10 UTC
Created attachment 444446 [details]
emerge --info

After having upgraded to gcc-6.2.0 I can't build x11-libs/wxGTK- anymore.

Error snippet:

> In file included from /var/tmp/portage/x11-libs/wxGTK-
> /var/tmp/portage/x11-libs/wxGTK- At global scope:
> /var/tmp/portage/x11-libs/wxGTK- error: narrowing conversion of '128' from 'int' to 'char' inside { } [-Wnarrowing]
>    0x08, 0x08, 0x04, 0x04, 0x02, 0x02, 0x01, 0x01};
>                                                  ^

I can build wxGTK just fine with gcc-5.4.0.


# emerge -pv =x11-libs/wxGTK-

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] x11-libs/wxGTK-  USE="X gnome gstreamer opengl sdl tiff (-aqua) -debug -doc -odbc -pch" ABI_X86="(64) -32 (-x32)" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB
Comment 1 Francesco Turco 2016-08-30 15:47:04 UTC
Created attachment 444448 [details]
build log for wxGTK- using gcc-6.2.0
Comment 2 Denis Kaganovich 2016-08-31 12:22:00 UTC
Unlike wxGTK-3, this is solved for me by global "-w". I add to make.conf:
CXXFLAGS="$CXXFLAGS -fpermissive -fno-strict-aliasing -w"

PS Global "-w" for CFLAGS mostly good, but some random packages builds broken.
Comment 3 Francesco Turco 2016-08-31 22:01:16 UTC
Created attachment 444672 [details, diff]
Comment 4 Mart Raudsepp gentoo-dev 2016-09-16 17:29:57 UTC
Soap found done to 3.0, which does some churn to .cpp too, as gdk-pixbuf is taking a gchar (and it's C and doesn't care of this signedness really) and would instead warn there if the proper fix of converting to unsigned char or uint8_t is used.
So I think given this is old 2.8, backporting upstream patch would change some of the .cpp too, and many other places have received just a cast to char as well, this char casting is ACK for 2.8.
Comment 5 David Seifert gentoo-dev 2016-09-16 22:26:56 UTC
commit b98cf3b8e69fc19e26600992a236e99d175da5dc
Author: David Seifert <>
Date:   Fri Sep 16 23:48:11 2016 +0200

    x11-libs/wxGTK: Allow for compiling with GCC 6
    Gentoo-bug: 592442
    * Patch by Francesco Turco