build: work around GCC warnings on Flex code

See ef98967ada.

* src/flex-scanner.h: Disable -Wnull-dereference for GCC 6+.
This commit is contained in:
Akim Demaille
2018-09-06 21:24:16 +02:00
parent 9268d9aceb
commit 1dac131ec4

View File

@@ -45,7 +45,7 @@ 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
// 7.3.0).
// 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]
@@ -54,7 +54,7 @@ int FLEX_PREFIX (lex_destroy) (void);
// ./src/scan-skel.c:2031:19: error: potential null pointer dereference [-Werror=null-dereference]
// b->yy_input_file = file;
// ~~~~~~~~~~~~~~~~~^~~~~~
#if defined __GNUC__ && 7 <= __GNUC__
#if defined __GNUC__ && 6 <= __GNUC__
# pragma GCC diagnostic ignored "-Wnull-dereference"
#endif