From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 73230 invoked by alias); 27 Aug 2018 23:46:32 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 73027 invoked by uid 89); 27 Aug 2018 23:46:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=expressed X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 27 Aug 2018 23:46:12 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 09A993083391; Mon, 27 Aug 2018 23:45:59 +0000 (UTC) Received: from c64.redhat.com (ovpn-112-25.phx2.redhat.com [10.3.112.25]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5E19D7DA04; Mon, 27 Aug 2018 23:45:57 +0000 (UTC) From: David Malcolm To: Jakub Jelinek Cc: Joseph Myers , Richard Biener , GCC Patches , David Malcolm Subject: [PATCH] Fix version check for ATTRIBUTE_GCC_DUMP_PRINTF Date: Mon, 27 Aug 2018 23:46:00 -0000 Message-Id: <1535416331-352-1-git-send-email-dmalcolm@redhat.com> In-Reply-To: <20180827065751.GB2218@tucnak> References: <20180827065751.GB2218@tucnak> X-IsSubscribed: yes X-SW-Source: 2018-08/txt/msg01712.txt.bz2 On Mon, 2018-08-27 at 08:57 +0200, Jakub Jelinek wrote: > On Thu, Aug 02, 2018 at 01:54:07PM -0400, David Malcolm wrote: > > +/* An attribute for annotating formatting printing functions that > > use > > + the dumpfile/optinfo formatting codes. These are the > > pretty_printer > > + format codes (see pretty-print.c), with additional codes for > > middle-end > > + specific entities (see dumpfile.c). */ > > + > > +#if GCC_VERSION >= 3005 > > +#define ATTRIBUTE_GCC_DUMP_PRINTF(m, n) \ > > + __attribute__ ((__format__ (__gcc_dump_printf__, m ,n))) \ > > + ATTRIBUTE_NONNULL(m) > > +#else > > +#define ATTRIBUTE_GCC_DUMP_PRINTF(m, n) ATTRIBUTE_NONNULL(m) > > +#endif > > Why >= 3005 rather than >= 9000 ? I believe I copied the logic from one of the existing __format__ attribute macros. Maybe my thinking was that it expressed the version in which format checking was added. Yes, that's clearly the wrong version to use; sorry about that. > GCC 8 and earlier will not handle that format attribute anyway and > will just > loudly complain. > > Jakub Here a patch that does what you suggest. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. OK for trunk? gcc/ChangeLog: * dumpfile.h (ATTRIBUTE_GCC_DUMP_PRINTF): Change version check on GCC_VERSION for usage of "__gcc_dump_printf__" format from >= 3005 to >= 9000. --- gcc/dumpfile.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/dumpfile.h b/gcc/dumpfile.h index 0305d36..671b7b9 100644 --- a/gcc/dumpfile.h +++ b/gcc/dumpfile.h @@ -28,7 +28,7 @@ along with GCC; see the file COPYING3. If not see format codes (see pretty-print.c), with additional codes for middle-end specific entities (see dumpfile.c). */ -#if GCC_VERSION >= 3005 +#if GCC_VERSION >= 9000 #define ATTRIBUTE_GCC_DUMP_PRINTF(m, n) \ __attribute__ ((__format__ (__gcc_dump_printf__, m ,n))) \ ATTRIBUTE_NONNULL(m) -- 1.8.5.3