]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
ada-lex.l: Ignore register diagnostic also for g++ defaulting to ISO C++17
authorMark Wielaard <mark@klomp.org>
Fri, 21 Aug 2020 22:20:55 +0000 (00:20 +0200)
committerMark Wielaard <mark@klomp.org>
Sun, 23 Aug 2020 10:14:34 +0000 (12:14 +0200)
Building with a really old flex and a really new g++ is probably not
recommended, but it should not cause compile errors.

gdb/ChangeLog:

* ada-lex.l: Extend register warnings diagnostics comment for g++.

include/ChangeLog:

* diagnostics.h (DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER): Also define
for GCC version 7.0 or higher.

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

index 2e0534e2a609afbe4a099c709171fbddaeee18e8..a01a97fc1cbdb66889e71dbc3ac03c0ca8c85ab4 100644 (file)
@@ -1,3 +1,7 @@
+2020-08-21  Mark Wielaard  <mark@klomp.org>
+
+       * ada-lex.l: Extend register warnings diagnostics comment for g++.
+
 2020-08-22  Simon Marchi  <simon.marchi@efficios.com>
 
        * frame.c (enum class frame_id_status): New.
index 1e4bc20f77cbb2187acac642374880548071cdb7..edf28801944d082fe62ec7eeaac97aaead026f98 100644 (file)
@@ -45,7 +45,9 @@ POSEXP  (e"+"?{NUM10})
 
 /* 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.  */
+   as shipped with macOS 10.12.  The same happens with flex 2.5.37 and g++ 11
+   which defaults to ISO C++17, that does not allow register storage class
+   specifiers.  */
 DIAGNOSTIC_PUSH
 DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER
 
index d0475de1ce9f0c0228cb33ada338b29cc6eea3c6..53597cf06507ff5c35a2224c726553216032f5fa 100644 (file)
@@ -1,3 +1,8 @@
+2020-08-21  Mark Wielaard  <mark@klomp.org>
+
+       * diagnostics.h (DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER): Also define
+       for GCC 7.0 or higher.
+
 2020-08-10  Alex Coplan  <alex.coplan@arm.com>
 
        * opcode/aarch64.h (AARCH64_MAX_SYSREG_NAME_LEN): New.
index 82d871b5b2ac83ec10df56212f638bdb1a442aaa..0f0a33c1a1ed67ecf585c2b253abe213fef4b9ba 100644 (file)
 
 #elif defined (__GNUC__) /* GCC */
 
+# if __GNUC__ >= 7
+#  define DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER \
+   DIAGNOSTIC_IGNORE ("-Wregister")
+# endif
+
 # define DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION \
   DIAGNOSTIC_IGNORE ("-Wstringop-truncation")