Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 582606 - dev-util/ragel-6.9: build w/gcc-6: error: narrowing conversion of '18446744073709551615ul' from 'long unsigned int' to 'long long int' inside { } [-Wnarrowing]
Summary: dev-util/ragel-6.9: build w/gcc-6: error: narrowing conversion of '1844674407...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Luca Barbato
URL:
Whiteboard:
Keywords:
: 593820 (view as bug list)
Depends on:
Blocks: gcc-6
  Show dependency tree
 
Reported: 2016-05-09 21:54 UTC by Peter Levine
Modified: 2017-11-18 18:10 UTC (History)
10 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
ragel-6.9:20160509-214745.log.gz (ragel-6.9:20160509-214745.log.gz,7.21 KB, application/gzip)
2016-05-09 21:56 UTC, Peter Levine
Details
emerge --info (emerge-info.txt,20.47 KB, text/plain)
2016-05-09 21:56 UTC, Peter Levine
Details
ragel-6.9-gcc6.patch (ragel-6.9-gcc6.patch,1.99 KB, patch)
2016-05-09 22:03 UTC, Peter Levine
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Levine 2016-05-09 21:54:46 UTC
Compiling dev-util/ragel-6.9 with gcc-6* fails with narrowing conversion errors such as:


error: narrowing conversion of '18446744073709551615ul' from 'long unsigned int' to 'long long int' inside { } [-Wnarrowing]


and template errors such as:


error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and 'std::ostream {aka std::basic_ostream<char>}')
Comment 1 Peter Levine 2016-05-09 21:56:01 UTC
Created attachment 433794 [details]
ragel-6.9:20160509-214745.log.gz
Comment 2 Peter Levine 2016-05-09 21:56:27 UTC
Created attachment 433796 [details]
emerge --info
Comment 3 Peter Levine 2016-05-09 22:03:25 UTC
Created attachment 433798 [details, diff]
ragel-6.9-gcc6.patch

A patch to ragel-6.9 to compile with gcc-6*.  It seems certain implicit conversions are now errors in c++11/c++1z mode.  The patch just applies some explicit casts to overcome this.
Comment 4 Aric Belsito 2016-06-11 20:03:52 UTC
@Peter
just FYI we can also solve this problem by appending '-std=c++98' to CXXFLAGS.
Comment 5 Peter Levine 2016-06-11 21:53:14 UTC
(In reply to Aric Belsito from comment #4)
> @Peter
> just FYI we can also solve this problem by appending '-std=c++98' to
> CXXFLAGS.

You could solve most gcc-6 problems with that but it's a band-aid that should be used only temporarily and when necessary.  If upstream doesn't fix their builds for gcc-6 it may be necessary but unnecessarily forcing '-std=c++98' may cause breakage in dependent packages.  For instance, last I checked dev-libs/boost did/does this and makes it hard to debug such problems with dev-util/source-highlight (see: https://bugs.gentoo.org/show_bug.cgi?id=582696). That creates a situation where both packages would have to force '-std=c++98' or take them off.
Comment 6 Aric Belsito 2016-06-12 09:03:13 UTC
@Peter

Yeah, that's true.

I'll probably go back to the other bugs I submitted about similar problems and try and work out some actual fixes.
Comment 7 Francesco Turco 2016-08-30 13:22:33 UTC
Patch from comment 3 works for me too.
Comment 8 David Seifert gentoo-dev 2016-09-15 07:49:22 UTC
*** Bug 593820 has been marked as a duplicate of this bug. ***
Comment 9 Roy Bamford gentoo-dev 2016-11-27 11:27:04 UTC
Works on arm64, cortex-a53 CPU.
Comment 10 Anthony Ryan 2016-12-11 07:19:53 UTC
While not a fix for this issue: https://github.com/gentoo/gentoo/pull/3078 ragel 7.0 builds fine for me with GCC6.
Comment 11 C. Wijtmans 2017-01-09 16:06:22 UTC
can be marked as fixed with the version bump and patches? (about time we get GCC-6 stable now with the upcoming release of gcc-7?)
Comment 12 Peter Levine 2017-03-17 20:56:13 UTC
(In reply to C.J. Wijtmans from comment #11)
> can be marked as fixed with the version bump and patches? (about time we get
> GCC-6 stable now with the upcoming release of gcc-7?)

Fixed in upstream:
> commit b36524576acfccf840842f4a615855e5b51c247e
> Author: Adrian Thurston <thurston@complang.org>
> Date:   Tue Jun 28 13:02:28 2016 -0400
> 
>     use separate signed/unsigned values for host type min/max
>     
>     Using separate values avoids the need to type cast before the data goes into
>     FsmCtx structs. Keep it in native types until it is used.


dev-util/ragel-7.0.0.9::gentoo compiles fine for me

dev-util/ragel-6.9::gentoo compiles with ragel-6.9-gcc6.patch


Using gcc-6.3.0
Comment 13 Pacho Ramos gentoo-dev 2017-04-04 11:24:32 UTC
closing as fixed in 7.0.0.9
Comment 14 Cheba 2017-06-20 08:55:22 UTC
Ragel 6.9 is still can not be avoided.

For instance, mail-filter/rspamd-1.6.1 depends on <dev-util/ragel-7.0.
Comment 15 Andreas K. Hüttel archtester gentoo-dev 2017-09-26 18:42:25 UTC
(In reply to Cheba from comment #14)
> Ragel 6.9 is still can not be avoided.
> 
> For instance, mail-filter/rspamd-1.6.1 depends on <dev-util/ragel-7.0.

Reopening then. We also need a fixed version stable soon.
Comment 16 Peter Levine 2017-10-25 05:21:03 UTC
PR: https://github.com/gentoo/gentoo/pull/6043
Comment 17 Larry the Git Cow gentoo-dev 2017-11-18 18:10:26 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=659cb1b6308cd164dc73ef9b9da3087385690837

commit 659cb1b6308cd164dc73ef9b9da3087385690837
Author:     Peter Levine <plevine457@gmail.com>
AuthorDate: 2017-10-25 05:10:47 +0000
Commit:     David Seifert <soap@gentoo.org>
CommitDate: 2017-11-18 18:09:09 +0000

    dev-util/ragel: Fix building with GCC-6
    
    Closes: https://bugs.gentoo.org/582606
    Package-Manager: Portage-2.3.11, Repoman-2.3.3
    Closes: https://github.com/gentoo/gentoo/pull/6043

 dev-util/ragel/files/ragel-6.9-gcc6.patch | 42 +++++++++++++++++++++++++++++++
 dev-util/ragel/ragel-6.9.ebuild           |  1 +
 2 files changed, 43 insertions(+)