* [PATCH] include: Define macro to ignore -Wdeprecated-declarations on GCC
@ 2022-10-27 7:06 Tsukasa OI
2022-10-27 23:47 ` Alan Modra
0 siblings, 1 reply; 2+ messages in thread
From: Tsukasa OI @ 2022-10-27 7:06 UTC (permalink / raw)
To: Tsukasa OI, Nick Clifton; +Cc: binutils
"-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 | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/diagnostics.h b/include/diagnostics.h
index c1a2e8f520c..3a75f4e2719 100644
--- a/include/diagnostics.h
+++ b/include/diagnostics.h
@@ -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")
base-commit: 2c02c72c62d2e9f590155561ebc54ca87bc10c2a
--
2.37.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] include: Define macro to ignore -Wdeprecated-declarations on GCC
2022-10-27 7:06 [PATCH] include: Define macro to ignore -Wdeprecated-declarations on GCC Tsukasa OI
@ 2022-10-27 23:47 ` Alan Modra
0 siblings, 0 replies; 2+ messages in thread
From: Alan Modra @ 2022-10-27 23:47 UTC (permalink / raw)
To: Tsukasa OI; +Cc: Nick Clifton, binutils
On Thu, Oct 27, 2022 at 07:06:01AM +0000, Tsukasa OI via Binutils wrote:
> * diagnostics.h (DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS):
> Define also on GCC.
OK.
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-10-27 23:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-27 7:06 [PATCH] include: Define macro to ignore -Wdeprecated-declarations on GCC Tsukasa OI
2022-10-27 23:47 ` Alan Modra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).