summaryrefslogtreecommitdiff
path: root/gdb/ada-lex.l
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2017-06-26 15:08:35 +0200
committerSimon Marchi <simon.marchi@ericsson.com>2017-06-26 16:51:17 +0200
commitd1435379df189d1c358ebd9776af8824a9158533 (patch)
tree6a5249f099b9284841dca89abcd90f906abf7558 /gdb/ada-lex.l
parent04e15b4a9462cb1ae819e878a6009829aab8020b (diff)
ada-lex: Ignore warnings about register keyword
Some older versions of flex (such as the one shipped with macOS) generate code that use the register keyword, which clang warns about. This patch makes the compiler ignore those warnings for the portion of the code generated by flex. gdb/ChangeLog: * common/diagnostics.h (DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER): New macro. * ada-lex.l: Ignore deprecated register warnings.
Diffstat (limited to 'gdb/ada-lex.l')
-rw-r--r--gdb/ada-lex.l10
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/ada-lex.l b/gdb/ada-lex.l
index 0825290214..fe97352d85 100644
--- a/gdb/ada-lex.l
+++ b/gdb/ada-lex.l
@@ -41,6 +41,14 @@ POSEXP (e"+"?{NUM10})
%{
+#include "common/diagnostics.h"
+
+/* Some old versions of flex generate code that uses the "register" keyword,
+ which clang warns about. This was observed for example with flex 2.5.35,
+ as shipped with macOS 10.12. */
+DIAGNOSTIC_PUSH
+DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER
+
#define NUMERAL_WIDTH 256
#define LONGEST_SIGN ((ULONGEST) 1 << (sizeof(LONGEST) * HOST_CHAR_BIT - 1))
@@ -648,3 +656,5 @@ dummy_function ada_flex_use[] =
{
(dummy_function) yyunput
};
+
+DIAGNOSTIC_POP