ada-lex: Ignore warnings about register keyword
authorSimon Marchi <simon.marchi@ericsson.com>
Mon, 26 Jun 2017 13:08:35 +0000 (15:08 +0200)
committerSimon Marchi <simon.marchi@ericsson.com>
Mon, 26 Jun 2017 14:51:17 +0000 (16:51 +0200)
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.

gdb/ChangeLog
gdb/ada-lex.l
gdb/common/diagnostics.h

index e1ad84a4d24f99f8732d17992920e3ab682d3cb0..5b048627c901741f0035fd4a213e6133d78d5d4c 100644 (file)
@@ -1,3 +1,9 @@
+2017-06-26  Simon Marchi  <simon.marchi@ericsson.com>
+
+       * common/diagnostics.h (DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER):
+       New macro.
+       * ada-lex.l: Ignore deprecated register warnings.
+
 2017-06-25  Simon Marchi  <simon.marchi@ericsson.com>
 
        * main.c (get_init_files): Replace "SYSTEM_GDBINIT +
index 08252902147d639ff9d76dc593177fcfa0724501..fe97352d85100ac4406f533012dea982ac476399 100644 (file)
@@ -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
index 5a63bfd8d4ee949e98453a756d55b11d39e55ee0..35bacf25bb1531a038cbcbc367076e9e2bbb4d0a 100644 (file)
 
 #ifdef __clang__
 # define DIAGNOSTIC_IGNORE_SELF_MOVE DIAGNOSTIC_IGNORE ("-Wself-move")
+# define DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER \
+  DIAGNOSTIC_IGNORE ("-Wdeprecated-register")
 #else
 # define DIAGNOSTIC_IGNORE_SELF_MOVE
+# define DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER
 #endif
 
 #endif /* COMMON_DIAGNOSTICS_H */
This page took 0.030186 seconds and 4 git commands to generate.