From 65fa634cdcfc5cf59b8b074670f488bba4df57cd Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Mon, 17 Sep 2018 05:54:23 +0200 Subject: [PATCH] doc: work around Flex's use of 'register' The CI uses an old version of Flex. * doc/bison.texi (calc++/scanner.ll): Here. --- doc/bison.texi | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) 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 %@{ -// 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 -// . +// 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 . # 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 %@} @end example @end ignore