[gnome-continuous-yocto/gnomeostree-3.28-rocko: 2214/8267] flex: fix gcc-6 failure



commit bacb105e328b2d145cde9d6def08d51389121570
Author: Andreas Müller <schnitzeltony googlemail com>
Date:   Tue Aug 30 17:51:04 2016 +0200

    flex: fix gcc-6 failure
    
    Gcc-6 does not allow c++ comments withing c-code. Files generated by flex
    can fail with:
    
    | error: C++ style comments are not allowed in ISO C90
    | num_to_alloc = 1; // After all that talk, this was set to 1 anyways...
    
    (From OE-Core rev: 6336c5bafe617e775037d5243d4bb5e236e74679)
    
    Signed-off-by: Andreas Müller <schnitzeltony googlemail com>
    Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>

 ...oid-c-comments-in-c-code-fails-with-gcc-6.patch |   64 ++++++++++++++++++++
 meta/recipes-devtools/flex/flex_2.6.0.bb           |    1 +
 2 files changed, 65 insertions(+), 0 deletions(-)
---
diff --git a/meta/recipes-devtools/flex/flex/0002-avoid-c-comments-in-c-code-fails-with-gcc-6.patch 
b/meta/recipes-devtools/flex/flex/0002-avoid-c-comments-in-c-code-fails-with-gcc-6.patch
new file mode 100644
index 0000000..438ca5f
--- /dev/null
+++ b/meta/recipes-devtools/flex/flex/0002-avoid-c-comments-in-c-code-fails-with-gcc-6.patch
@@ -0,0 +1,64 @@
+From 7072befe1397af4eb01c3ff7edf99f0cd5076089 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony googlemail com>
+Date: Tue, 30 Aug 2016 14:25:32 +0200
+Subject: [PATCH] avoid c++ comments in c-code - fails with gcc-6
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+fixes:
+
+| error: C++ style comments are not allowed in ISO C90
+| num_to_alloc = 1; // After all that talk, this was set to 1 anyways...
+
+Upstream-Status: Pending
+
+Signed-off-by: Andreas Müller <schnitzeltony googlemail com>
+---
+ src/flex.skl | 2 +-
+ src/scan.c   | 2 +-
+ src/skel.c   | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/flex.skl b/src/flex.skl
+index 73a0b9e..ed71627 100644
+--- a/src/flex.skl
++++ b/src/flex.skl
+@@ -2350,7 +2350,7 @@ void yyFlexLexer::yyensure_buffer_stack(void)
+                * scanner will even need a stack. We use 2 instead of 1 to avoid an
+                * immediate realloc on the next call.
+          */
+-              num_to_alloc = 1; // After all that talk, this was set to 1 anyways...
++              num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
+               YY_G(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
+                                                               (num_to_alloc * sizeof(struct 
yy_buffer_state*)
+                                                               M4_YY_CALL_LAST_ARG);
+diff --git a/src/scan.c b/src/scan.c
+index b55df2d..f1dce75 100644
+--- a/src/scan.c
++++ b/src/scan.c
+@@ -4672,7 +4672,7 @@ static void yyensure_buffer_stack (void)
+                * scanner will even need a stack. We use 2 instead of 1 to avoid an
+                * immediate realloc on the next call.
+          */
+-              num_to_alloc = 1; // After all that talk, this was set to 1 anyways...
++              num_to_alloc = 1; /* After all that talk, this was set to 1 anyways...*/
+               (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
+                                                               (num_to_alloc * sizeof(struct 
yy_buffer_state*)
+                                                               );
+diff --git a/src/skel.c b/src/skel.c
+index ef657d3..26cc889 100644
+--- a/src/skel.c
++++ b/src/skel.c
+@@ -2561,7 +2561,7 @@ const char *skel[] = {
+   "            * scanner will even need a stack. We use 2 instead of 1 to avoid an",
+   "            * immediate realloc on the next call.",
+   "         */",
+-  "           num_to_alloc = 1; // After all that talk, this was set to 1 anyways...",
++  "           num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */",
+   "           YY_G(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc",
+   "                                                           (num_to_alloc * sizeof(struct 
yy_buffer_state*)",
+   "                                                           M4_YY_CALL_LAST_ARG);",
+-- 
+2.5.5
+
diff --git a/meta/recipes-devtools/flex/flex_2.6.0.bb b/meta/recipes-devtools/flex/flex_2.6.0.bb
index f6d136c..db2cf1c 100644
--- a/meta/recipes-devtools/flex/flex_2.6.0.bb
+++ b/meta/recipes-devtools/flex/flex_2.6.0.bb
@@ -14,6 +14,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/flex/flex-${PV}.tar.bz2 \
            file://run-ptest \
            file://do_not_create_pdf_doc.patch \
            file://0001-tests-add-a-target-for-building-tests-without-runnin.patch \
+           file://0002-avoid-c-comments-in-c-code-fails-with-gcc-6.patch \
            ${@bb.utils.contains('PTEST_ENABLED', '1', '', 'file://disable-tests.patch', d)} \
            "
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]