From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1039) id 71BCB3857806; Wed, 16 Mar 2022 13:44:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 71BCB3857806 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: H.J. Lu To: bfd-cvs@sourceware.org, gdb-cvs@sourceware.org Subject: [binutils-gdb] gprofng: Define ATTRIBUTE_FALLTHROUGH X-Act-Checkin: binutils-gdb X-Git-Author: H.J. Lu X-Git-Refname: refs/heads/master X-Git-Oldrev: 0c857ef4dfc083b6f5ef2d32182b8db24c5f8d55 X-Git-Newrev: c5edd3b8847f118bd022c473b126695fb39f6412 Message-Id: <20220316134430.71BCB3857806@sourceware.org> Date: Wed, 16 Mar 2022 13:44:30 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2022 13:44:30 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dc5edd3b8847f= 118bd022c473b126695fb39f6412 commit c5edd3b8847f118bd022c473b126695fb39f6412 Author: H.J. Lu Date: Tue Mar 15 08:49:01 2022 -0700 gprofng: Define ATTRIBUTE_FALLTHROUGH =20 Define ATTRIBUTE_FALLTHROUGH to __attribute__ ((fallthrough)) only for GCC 7 or above. =20 PR gprof/28969 * common/gp-defs.h (ATTRIBUTE_FALLTHROUGH): New. * src/gp-collect-app.cc (collect::check_args): Replace /* FALLTHROUGH */ with ATTRIBUTE_FALLTHROUGH. Diff: --- gprofng/common/gp-defs.h | 8 ++++++++ gprofng/src/gp-collect-app.cc | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gprofng/common/gp-defs.h b/gprofng/common/gp-defs.h index 440bfb1c5e2..e92c33e101b 100644 --- a/gprofng/common/gp-defs.h +++ b/gprofng/common/gp-defs.h @@ -55,4 +55,12 @@ #define WSIZE_32 1 #endif =20 +#ifndef ATTRIBUTE_FALLTHROUGH +# if (GCC_VERSION >=3D 7000) +# define ATTRIBUTE_FALLTHROUGH __attribute__ ((__fallthrough__)) +# else +# define ATTRIBUTE_FALLTHROUGH /* Fall through */ +# endif +#endif + #endif diff --git a/gprofng/src/gp-collect-app.cc b/gprofng/src/gp-collect-app.cc index a40cf8fb9be..34874b8c296 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 =3D true; - /* FALLTHROUGH */ + ATTRIBUTE_FALLTHROUGH case 'o': if (precheck =3D=3D 1) {