From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sender-0.a4lg.com (mail-sender-0.a4lg.com [IPv6:2401:2500:203:30b:4000:6bfe:4757:0]) by sourceware.org (Postfix) with ESMTPS id 8A081382DE25 for ; Thu, 27 Oct 2022 07:06:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8A081382DE25 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=irq.a4lg.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=irq.a4lg.com Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 71B9B300089; Thu, 27 Oct 2022 07:06:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irq.a4lg.com; s=2017s01; t=1666854373; bh=rCdZbOC7J0zMjvX4WpGQrbWTaV8+IIOsVALVXJe0oIk=; h=From:To:Cc:Subject:Date:Message-Id:Mime-Version: Content-Transfer-Encoding; b=cVV+kvc3Z3hfzrwrSMvdRlaS1bf8p2l5c5L70y9yldv7ce0ZvxuFV82fMoImay3Ax Z/04SEJU9EjztCuEgkV47VK0MOx+ZPBFY/1JTnswwzS5FFmcQ9IjSzsnrn0T+GuXzV kCV3v9KPEZBSkoDnuT4RpZtkSJmgoIuYLwOeis1w= From: Tsukasa OI To: Tsukasa OI , Nick Clifton Cc: binutils@sourceware.org Subject: [PATCH] include: Define macro to ignore -Wdeprecated-declarations on GCC Date: Thu, 27 Oct 2022 07:06:01 +0000 Message-Id: <9df9d9e5bb4c7594b76c40613a349b4d2364e9c5.1666854355.git.research_trasio@irq.a4lg.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: "-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