bison-patches
[Top][All Lists]
Advanced

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

doc: work around Flex's use of 'register'


From: Akim Demaille
Subject: doc: work around Flex's use of 'register'
Date: Mon, 17 Sep 2018 18:46:09 +0200

One more commit to please the CI.

commit 8fef80698480f46d39d1cedfead3a294e000181c
Author: Akim Demaille <address@hidden>
Date:   Mon Sep 17 05:54:23 2018 +0200

    doc: work around Flex's use of 'register'
    
    The CI uses an old version of Flex.
    
    * doc/bison.texi (calc++/scanner.ll): Here.

diff --git a/doc/bison.texi b/doc/bison.texi
index ab8c6cba..db8d7d53 100644
--- a/doc/bison.texi
+++ b/doc/bison.texi
@@ -11422,10 +11422,9 @@ then the parser's to get the set of defined tokens.
 @comment file: calc++/scanner.ll
 @example
 address@hidden
-// Work around an incompatibility in flex (at least versions
-// 2.5.31 through 2.5.33): it generates code that does
-// not conform to C89.  See Debian bug 333231
-// <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=333231>.
+// Work around an incompatibility in flex (at least versions 2.5.31 through
+// 2.5.33): it generates code that does not conform to C89.  See Debian bug
+// 333231 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=333231>.
 # undef yywrap
 # define yywrap() 1
 
@@ -11435,6 +11434,8 @@ then the parser's to get the set of defined tokens.
 # pragma GCC diagnostic ignored "-Wnull-dereference"
 #endif
 
+#define FLEX_VERSION (YY_FLEX_MAJOR_VERSION * 100 + YY_FLEX_MINOR_VERSION)
+
 // Old versions of Flex (2.5.35) generate an incomplete documentation comment.
 //
 //  In file included from src/scan-code-c.c:3:
@@ -11443,9 +11444,15 @@ then the parser's to get the set of defined tokens.
 //   * @param line_number
 //     ~~~~~~~~~~~~~~~~~^
 //  1 error generated.
-#if YY_FLEX_MAJOR_VERSION * 1000 + YY_FLEX_MINOR_VERSION <= 2006 && defined 
__clang__
+#if FLEX_VERSION < 206 && defined __clang__
 # pragma clang diagnostic ignored "-Wdocumentation"
 #endif
+
+// Old versions of Flex (2.5.35) use 'register'.  Warnings introduced in
+// GCC 7.
+#if FLEX_VERSION < 206 && defined __GNUC__ && !defined __clang__ && 7 <= 
__GNUC__
+# pragma GCC diagnostic ignored "-Wregister"
+#endif
 address@hidden
 @end example
 @end ignore




reply via email to

[Prev in Thread] Current Thread [Next in Thread]