Bug 363078 - Building k3b-2.0.3 with GCC-6 fails with "error: narrowing conversion of '172' from 'int' to 'char' inside { } [-Wnarrowing]"
Summary: Building k3b-2.0.3 with GCC-6 fails with "error: narrowing conversion of '172...
Status: RESOLVED FIXED
Alias: None
Product: k3b
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: k3b developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-14 16:57 UTC by nsane457
Modified: 2016-05-14 19:45 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.0.4
Sentry Crash Report:


Attachments
k3b-2.0.3-gcc6.patch (3.48 KB, patch)
2016-05-14 16:58 UTC, nsane457
Details

Note You need to log in before you can comment on or make changes to this bug.
Description nsane457 2016-05-14 16:57:24 UTC
Building k3b-2.0.3 with GCC-6 fails with narrowing conversion errors such as:

> /var/tmp/portage/app-cdr/k3b-2.0.3-r2/work/k3b-2.0.3/libk3b/tools/k3bwavefilewriter.cpp: In member function 'void K3b::WaveFileWriter::writeEmptyHeader()':
> /var/tmp/portage/app-cdr/k3b-2.0.3-r2/work/k3b-2.0.3/libk3b/tools/k3bwavefilewriter.cpp:125:9: error: narrowing conversion of '172' from 'int' to 'char' inside { } [-Wnarrowing

GCC-6 no longer allows for narrowing conversions  inside braced initialization lists.

Reproducible: Always

Steps to Reproduce:
1. emerge -1 =app-cdr/k3b-2.0.3-r2

Actual Results:  
error: narrowing conversion of '172' from 'int' to 'char' inside { } [-Wnarrowing]

Expected Results:  
Successful merge.
Comment 1 nsane457 2016-05-14 16:58:55 UTC
Created attachment 98973 [details]
k3b-2.0.3-gcc6.patch

A patch to apply explicit casts
Comment 2 Johannes Obermayr 2016-05-14 19:45:55 UTC
Git commit da6373a3e1ae9199ee50e326fe296c03b50625ae by Johannes Obermayr, on behalf of P. Levine.
Committed on 14/05/2016 at 19:43.
Pushed by jobermayr into branch '2.0'.

Fix narrowing conversions from 'int' to 'const char' inside { }.

Please provide a proper git patch including author information next time ...
FIXED-IN: 2.0.4

M  +1    -1    libk3b/projects/k3bcdrdaowriter.cpp
M  +11   -11   libk3b/tools/k3bwavefilewriter.cpp
M  +11   -11   plugins/encoder/external/k3bexternalencoder.cpp

http://commits.kde.org/k3b/da6373a3e1ae9199ee50e326fe296c03b50625ae