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.
+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 +
%{
+#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))
{
(dummy_function) yyunput
};
+
+DIAGNOSTIC_POP
#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 */