]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
include: Define macro to ignore -Wdeprecated-declarations on GCC
authorTsukasa OI <research_trasio@irq.a4lg.com>
Thu, 27 Oct 2022 04:33:37 +0000 (04:33 +0000)
committerTsukasa OI <research_trasio@irq.a4lg.com>
Fri, 28 Oct 2022 05:32:11 +0000 (05:32 +0000)
"-Wdeprecated-declarations" warning option can be helpful to track
deprecated function delarations but sometimes we need to disable this
warning for a good reason.

DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS is an existing macro but only
defined on Clang.  Since "-Wdeprecated-declarations" is also available on
GCC (>= 3.4.0), this commit adds equivalent definition as Clang.

__GNUC__ and __GNUC_MINOR__ are not checked because this header file seems
to assume GCC >= 4.6 (with "GCC diagnostic push/pop").

include/ChangeLog:

* diagnostics.h (DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS):
Define also on GCC.

include/diagnostics.h

index c1a2e8f520c7f6edc52facbeace21bc1582b4728..3a75f4e27191214d28abf083737a83d208ea707a 100644 (file)
@@ -78,6 +78,9 @@
 
 #elif defined (__GNUC__) /* GCC */
 
+# define DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS \
+  DIAGNOSTIC_IGNORE ("-Wdeprecated-declarations")
+
 # if __GNUC__ >= 7
 #  define DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER \
    DIAGNOSTIC_IGNORE ("-Wregister")