build: work around warnings in Flex 2.5.35

That's the version on Ubuntu Precise.
See also 1dac131ec4.

* src/flex-scanner.h: Disable -Wdocumentation.
* doc/bison.texi: Turn off a warning triggered by Flex 2.6.4.
This commit is contained in:
Akim Demaille
2018-09-08 06:47:08 +02:00
parent ec99c418a7
commit ea0db44fed
2 changed files with 28 additions and 16 deletions

View File

@@ -11426,8 +11426,8 @@ parser's to get the set of defined tokens.
# define yywrap() 1
// Pacify warnings in yy_init_buffer (observed with Flex 2.6.4)
// and GCC 7.3.0.
#if defined __GNUC__ && 7 <= __GNUC__
// and GCC 6.4.0, 7.3.0.
#if defined __GNUC__ && !defined __clang__ && 6 <= __GNUC__
# pragma GCC diagnostic ignored "-Wnull-dereference"
#endif
%@}

View File

@@ -27,6 +27,32 @@
+ (YY_FLEX_MINOR_VERSION) * 1000 \
+ (YY_FLEX_SUBMINOR_VERSION))
// Pacify warnings in yy_init_buffer (observed with Flex 2.6.4 and GCC
// 6.4.0 and 7.3.0).
//
// ./src/scan-skel.c: In function 'skel_restart':
// ./src/scan-skel.c:2035:20: error: potential null pointer dereference [-Werror=null-dereference]
// b->yy_fill_buffer = 1;
// ~~~~~~~~~~~~~~~~~~^~~
// ./src/scan-skel.c:2031:19: error: potential null pointer dereference [-Werror=null-dereference]
// b->yy_input_file = file;
// ~~~~~~~~~~~~~~~~~^~~~~~
#if defined __GNUC__ && ! defined __clang__ && 6 <= __GNUC__
# pragma GCC diagnostic ignored "-Wnull-dereference"
#endif
// Old versions of Flex (2.5.35) generate an incomplete documentation comment.
//
// In file included from src/scan-code-c.c:3:
// src/scan-code.c:2198:21: error: empty paragraph passed to '@param' command
// [-Werror,-Wdocumentation]
// * @param line_number
// ~~~~~~~~~~~~~~~~~^
// 1 error generated.
#if FLEX_VERSION <= 20060000 && defined __clang__
# pragma clang diagnostic ignored "-Wdocumentation"
#endif
/* Pacify "gcc -Wmissing-prototypes" when flex 2.5.31 is used. */
#if FLEX_VERSION <= 2005031
int FLEX_PREFIX (get_lineno) (void);
@@ -44,20 +70,6 @@ int FLEX_PREFIX (lex_destroy) (void);
#define last_string FLEX_PREFIX (last_string)
// Pacify warnings in yy_init_buffer (observed with Flex 2.6.4 and GCC
// 6.4.0 and 7.3.0).
//
// ./src/scan-skel.c: In function 'skel_restart':
// ./src/scan-skel.c:2035:20: error: potential null pointer dereference [-Werror=null-dereference]
// b->yy_fill_buffer = 1;
// ~~~~~~~~~~~~~~~~~~^~~
// ./src/scan-skel.c:2031:19: error: potential null pointer dereference [-Werror=null-dereference]
// b->yy_input_file = file;
// ~~~~~~~~~~~~~~~~~^~~~~~
#if defined __GNUC__ && 6 <= __GNUC__
# pragma GCC diagnostic ignored "-Wnull-dereference"
#endif
/* It seems to be a nice "feature" of Flex that one cannot use yytext,
yyleng etc. when a prefix is given, since there is no longer a
#define, but rather the token is actually changed in the output.