public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Jose E. Marchesi" <jose.marchesi@oracle.com>
To: "H.J. Lu via Binutils" <binutils@sourceware.org>
Subject: Re: [PATCH 1/3] gprofng: Define ATTRIBUTE_FALLTHROUGH
Date: Tue, 15 Mar 2022 21:10:43 +0100	[thread overview]
Message-ID: <87fsnjj7ss.fsf@oracle.com> (raw)
In-Reply-To: <20220315162204.2659495-2-hjl.tools@gmail.com> (H. J. Lu via Binutils's message of "Tue, 15 Mar 2022 09:22:02 -0700")



> Define ATTRIBUTE_FALLTHROUGH to __attribute__ ((fallthrough)) only for
> GCC 7 or above.
>
> 	PR gprof/28969
> 	* common/gp-defs.h (ATTRIBUTE_FALLTHROUGH): New.
> 	* src/gp-collect-app.cc (collect::check_args): Replace
> 	__attribute__ ((fallthrough)) with ATTRIBUTE_FALLTHROUGH.

Oh sorry HJ I just pushed the patch below as obvious because I couldn't
build gprofng with GCC 6.  Didnt see your patch here which is better.

commit 6aa03e9c1769c8d925f4d23d72af93483bfd31f3
Author: Jose E. Marchesi <jose.marchesi@oracle.com>
Date:   Tue Mar 15 21:04:57 2022 +0100

    gprofng: avoid using `fallthrough' attributes
    
    gprofng didn't build with gcc 6.3 due to the usage of __attribute__
    ((fallthrough)).  This patch uses /* FALLTHROUGH */ instead.
    
    2022-03-15  Jose E. Marchesi  <jose.marchesi@oracle.com>
    
            * gprofng/src/gp-collect-app.cc (collect::check_args): Use
            fallthrough comment instead of attribute.

diff --git a/ChangeLog b/ChangeLog
index 73b6085d6ef..dfe468c0af4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2022-03-15  Jose E. Marchesi  <jose.marchesi@oracle.com>
+
+	* gprofng/src/gp-collect-app.cc (collect::check_args): Use
+	fallthrough comment instead of attribute.
+
 2022-03-11  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
 
 	* Makefile.def: Add gprofng module.
diff --git a/gprofng/src/gp-collect-app.cc b/gprofng/src/gp-collect-app.cc
index afaae70bc2b..a40cf8fb9be 100644
--- a/gprofng/src/gp-collect-app.cc
+++ b/gprofng/src/gp-collect-app.cc
@@ -848,7 +848,7 @@ collect::check_args (int argc, char *argv[])
 	  }
 	case 'O':
 	  overwriteExp = true;
-	  __attribute__ ((fallthrough));
+          /* FALLTHROUGH */
 	case 'o':
 	  if (precheck == 1)
 	    {

  reply	other threads:[~2022-03-15 20:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-15 16:22 [PATCH 0/3] gprofng: Support build with older versions of GCC H.J. Lu
2022-03-15 16:22 ` [PATCH 1/3] gprofng: Define ATTRIBUTE_FALLTHROUGH H.J. Lu
2022-03-15 20:10   ` Jose E. Marchesi [this message]
2022-03-15 16:22 ` [PATCH 2/3] gprofng: Don't hardcode -Wno-nonnull-compare H.J. Lu
2022-03-15 16:22 ` [PATCH 3/3] gprofng: Don't hardcode -Wno-format-truncation/-Wno-switch H.J. Lu
2022-03-16  0:49 ` [PATCH 0/3] gprofng: Support build with older versions of GCC Alan Modra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fsnjj7ss.fsf@oracle.com \
    --to=jose.marchesi@oracle.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).