dev-util/ragel: Fix building with GCC-6
authorPeter Levine <plevine457@gmail.com>
Wed, 25 Oct 2017 05:10:47 +0000 (01:10 -0400)
committerDavid Seifert <soap@gentoo.org>
Sat, 18 Nov 2017 18:09:09 +0000 (19:09 +0100)
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 [new file with mode: 0644]
dev-util/ragel/ragel-6.9.ebuild

diff --git a/dev-util/ragel/files/ragel-6.9-gcc6.patch b/dev-util/ragel/files/ragel-6.9-gcc6.patch
new file mode 100644 (file)
index 0000000..fb10d9f
--- /dev/null
@@ -0,0 +1,42 @@
+Bug: https://bugs.gentoo.org/582606
+
+--- a/ragel/common.cpp
++++ b/ragel/common.cpp
+@@ -34,7 +34,7 @@
+       { "int",      0,       "int",     true,   true,  false,  INT_MIN,   INT_MAX,    sizeof(int) },
+       { "unsigned", "int",   "uint",    false,  true,  false,  0,         UINT_MAX,   sizeof(unsigned int) },
+       { "long",     0,       "long",    true,   true,  false,  LONG_MIN,  LONG_MAX,   sizeof(long) },
+-      { "unsigned", "long",  "ulong",   false,  true,  false,  0,         ULONG_MAX,  sizeof(unsigned long) }
++      { "unsigned", "long",  "ulong",   false,  true,  false,  0,         (long long) ULONG_MAX,  sizeof(unsigned long) }
+ };
+ #define S8BIT_MIN  -128
+@@ -87,7 +87,7 @@
+       { "int32",   0,  "int32",   true,   true,  false,  S32BIT_MIN, S32BIT_MAX,  4 },
+       { "uint32",  0,  "uint32",  false,  true,  false,  U32BIT_MIN, U32BIT_MAX,  4 },
+       { "int64",   0,  "int64",   true,   true,  false,  S64BIT_MIN, S64BIT_MAX,  8 },
+-      { "uint64",  0,  "uint64",  false,  true,  false,  U64BIT_MIN, U64BIT_MAX,  8 },
++      { "uint64",  0,  "uint64",  false,  true,  false,  U64BIT_MIN, (long long) U64BIT_MAX,  8 },
+       { "rune",    0,  "int32",   true,   true,  true,   S32BIT_MIN, S32BIT_MAX,  4 }
+ };
+@@ -116,7 +116,7 @@
+       { "int",     0,  "int",     true,   true,  false,  INT_MIN,   INT_MAX,     4 },
+       { "uint",    0,  "uint",    false,  true,  false,  0,         UINT_MAX,    4 },
+       { "long",    0,  "long",    true,   true,  false,  LONG_MIN,  LONG_MAX,    8 },
+-      { "ulong",   0,  "ulong",   false,  true,  false,  0,         ULONG_MAX,   8 }
++      { "ulong",   0,  "ulong",   false,  true,  false,  0,         (long long) ULONG_MAX,   8 }
+ };
+ HostType hostTypesOCaml[] =
+--- a/ragel/rbxgoto.cpp
++++ b/ragel/rbxgoto.cpp
+@@ -658,7 +658,7 @@
+       out <<
+               "       begin\n"
+               "               " << P() << " += 1\n"
+-              "               " << rbxGoto(ret, "_out") << "\n" 
++              "               " << static_cast<bool>(rbxGoto(ret, "_out")) << "\n"
+               "       end\n";
+ }
index bfa5a8aa19488ff8e26aa805a147e2d305034223..9de48f66793ebbb3648a39329c9491585280e58c 100644 (file)
@@ -20,6 +20,7 @@ RDEPEND=""
 # We need to get the txl language in Portage to have the tests :(
 RESTRICT=test
 
+PATCHES=( "${FILESDIR}"/${P}-gcc6.patch )
 DOCS=( ChangeLog CREDITS README TODO )
 
 src_test() {