From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2210) id 91CD93851C0D; Fri, 7 Aug 2020 17:40:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 91CD93851C0D Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Ken Brown To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: cygserver: build with -Wimplicit-fallthrough=5 X-Act-Checkin: newlib-cygwin X-Git-Author: Ken Brown X-Git-Refname: refs/heads/master X-Git-Oldrev: 1be41b802ae151f0dbc4e67fd3fd1cc563978643 X-Git-Newrev: 225d376b70f92bbb68b57b928a29044ab3c30acf Message-Id: <20200807174018.91CD93851C0D@sourceware.org> Date: Fri, 7 Aug 2020 17:40:18 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Aug 2020 17:40:18 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=225d376b70f92bbb68b57b928a29044ab3c30acf commit 225d376b70f92bbb68b57b928a29044ab3c30acf Author: Ken Brown Date: Fri Aug 7 09:48:28 2020 -0400 Cygwin: cygserver: build with -Wimplicit-fallthrough=5 Define the pseudo keyword 'fallthrough' in woutsup.h to support this. Diff: --- winsup/cygserver/Makefile.in | 2 +- winsup/cygserver/bsd_helper.cc | 2 +- winsup/cygserver/bsd_mutex.cc | 2 +- winsup/cygserver/woutsup.h | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/winsup/cygserver/Makefile.in b/winsup/cygserver/Makefile.in index bbdfc25fb..70f38233c 100644 --- a/winsup/cygserver/Makefile.in +++ b/winsup/cygserver/Makefile.in @@ -16,7 +16,7 @@ export CXX:=@CXX@ CFLAGS:=@CFLAGS@ override CXXFLAGS=@CXXFLAGS@ -override CXXFLAGS+=-MMD -Wimplicit-fallthrough=4 -Werror -D__OUTSIDE_CYGWIN__ -DSYSCONFDIR="\"$(sysconfdir)\"" +override CXXFLAGS+=-MMD -Wimplicit-fallthrough=5 -Werror -D__OUTSIDE_CYGWIN__ -DSYSCONFDIR="\"$(sysconfdir)\"" include ${srcdir}/../Makefile.common diff --git a/winsup/cygserver/bsd_helper.cc b/winsup/cygserver/bsd_helper.cc index ecc90e117..38639647e 100644 --- a/winsup/cygserver/bsd_helper.cc +++ b/winsup/cygserver/bsd_helper.cc @@ -120,7 +120,7 @@ ipcexit_hookthread (const LPVOID param) { case WAIT_OBJECT_0: /* Cygserver shutdown. */ - /*FALLTHRU*/ + fallthrough; case WAIT_OBJECT_0 + 1: /* Process exited. Call semexit_myhook to handle SEM_UNDOs for the exiting process and shmexit_myhook to keep track of shared diff --git a/winsup/cygserver/bsd_mutex.cc b/winsup/cygserver/bsd_mutex.cc index 13c5f90e8..0cda87a5b 100644 --- a/winsup/cygserver/bsd_mutex.cc +++ b/winsup/cygserver/bsd_mutex.cc @@ -326,7 +326,7 @@ _msleep (void *ident, struct mtx *mtx, int priority, break; case WAIT_OBJECT_0 + 1: /* Shutdown event (triggered by wakeup_all). */ priority |= PDROP; - /*FALLTHRU*/ + fallthrough; case WAIT_OBJECT_0 + 2: /* The dependent process has exited. */ debug ("msleep process exit or shutdown for %d", td->td_proc->winpid); ret = EIDRM; diff --git a/winsup/cygserver/woutsup.h b/winsup/cygserver/woutsup.h index 272f978c0..7b799f156 100644 --- a/winsup/cygserver/woutsup.h +++ b/winsup/cygserver/woutsup.h @@ -12,6 +12,8 @@ details. */ #error "woutsup.h is not for code being compiled inside the dll" #endif +#define fallthrough __attribute__((__fallthrough__)) + #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0500 #endif