Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 463744 - dev-lang/rubinius-1.2.4.20110705 with gcc-4.8 - vm/builtin/unpack.cpp:284:5: error:narrowing conversion of ‘2147483648u’ from ‘unsigned int’ to ‘const int32_t {aka const int}’ inside { } is ill-formed in C++11 [-Werror=narrowing]
Summary: dev-lang/rubinius-1.2.4.20110705 with gcc-4.8 - vm/builtin/unpack.cpp:284:5: ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Ruby Team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2013-03-29 15:46 UTC by Tom Li
Modified: 2013-08-28 10:18 UTC (History)
3 users (show)

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


Attachments
build.log (build.log,97.23 KB, text/plain)
2013-03-30 07:12 UTC, Tom Li
Details
emerge --info (emerge-info,5.33 KB, text/plain)
2013-03-30 07:12 UTC, Tom Li
Details
Fix build issue (fix.patch,1.67 KB, patch)
2013-03-30 07:16 UTC, Tom Li
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Li 2013-03-29 15:46:14 UTC
I'm using gcc 4.8, I can not build dev-lang/rubinius-1.2.4.20110705:

vm/builtin/unpack.cpp:284:5: error:narrowing conversion of ‘2147483648u’ from ‘unsigned int’ to ‘const int32_t {aka const int}’ inside { } is ill-formed in C++11 [-Werror=narrowing]
     };
     ^
cc1plus: all warnings being treated as errors

It is very easy to solve the issue. The patch solved the issue, and it shouldn't break anything when using gcc 4.6:

diff --git bad/vm/builtin/unpack.cpp good/vm/builtin/unpack.cpp
index b7a3850..48ca26f 100644
--- bad/vm/builtin/unpack.cpp
+++ good/vm/builtin/unpack.cpp
@@ -274,13 +274,13 @@ namespace rubinius {
     }
 
     static const int32_t utf8_limits[] = {
-      0x0,        /* 1 */
-      0x80,       /* 2 */
-      0x800,      /* 3 */
-      0x10000,    /* 4 */
-      0x200000,   /* 5 */
-      0x4000000,  /* 6 */
-      0x80000000, /* 7 */
+      (const int32_t) 0x0,        /* 1 */
+      (const int32_t) 0x80,       /* 2 */
+      (const int32_t) 0x800,      /* 3 */
+      (const int32_t) 0x10000,    /* 4 */
+      (const int32_t) 0x200000,   /* 5 */
+      (const int32_t) 0x4000000,  /* 6 */
+      (const int32_t) 0x80000000, /* 7 */
     };
 
 #define MALFORMED_UTF8_ERROR_SIZE 60
Comment 1 Tom Li 2013-03-30 01:26:42 UTC
dev-lang/rubinius seems no one to maintenance, because it keeps a very old version in portage. 

My patch solved the build issue, but in fact, if anyone could version bump it, we shouldn't have any issue on it.
Comment 2 Ryan Hill (RETIRED) gentoo-dev 2013-03-30 04:33:04 UTC
emerge --info and build log please.
Comment 3 Tom Li 2013-03-30 07:12:30 UTC
Created attachment 343696 [details]
build.log
Comment 4 Tom Li 2013-03-30 07:12:57 UTC
Created attachment 343698 [details]
emerge --info
Comment 5 Tom Li 2013-03-30 07:16:09 UTC
Created attachment 343700 [details, diff]
Fix build issue
Comment 6 Hans de Graaff gentoo-dev Security 2013-03-30 07:41:03 UTC
(In reply to comment #1)
> dev-lang/rubinius seems no one to maintenance, because it keeps a very old
> version in portage. 

Unfortunately the rubinius team no longer creates releases so there is nothing to bump. We could select our own releases from their repository, but that would require a dedicated maintainer with inside knowledge of the rubinius development process.
Comment 7 Hugo Mildenberger 2013-04-12 11:43:29 UTC
This problem happens with gcc-4.7.2. In a comment to the related bug entry #431200, Andrej Gelenberg suggests to remove "-Werror" from flags.
Comment 8 Ryan Hill (RETIRED) gentoo-dev 2013-04-13 04:27:56 UTC
Yeah building with -Werror is against our policies.  The -Werror should be removed regardless.
Comment 9 Hans de Graaff gentoo-dev Security 2013-04-21 08:35:16 UTC
I've patched the ebuild to remove the hardcoded -Werror (and also -ggdb3).