aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/fhandler_windows.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2020-08-05 21:58:22 +0200
committerCorinna Vinschen <corinna@vinschen.de>2020-08-05 21:58:22 +0200
commit50ad1980858b1092ebdd8c3dd6ae14d72596eb4d (patch)
tree1cf5f09b7554eed30007067719022243a440e4e5 /winsup/cygwin/fhandler_windows.cc
parent5898a044c32cf67a1fdc90c8ba48c166d2b11909 (diff)
downloadnewlib-50ad1980858b1092ebdd8c3dd6ae14d72596eb4d.zip
newlib-50ad1980858b1092ebdd8c3dd6ae14d72596eb4d.tar.gz
newlib-50ad1980858b1092ebdd8c3dd6ae14d72596eb4d.tar.bz2
Cygwin: Add 'fallthrough' pseudo keyword for switch/case use
This patch has been inspired by the Linux kernel patch 294f69e662d1 compiler_attributes.h: Add 'fallthrough' pseudo keyword for switch/case use written by Joe Perches <joe AT perches DOT com> based on an idea from Dan Carpenter <dan DOT carpenter AT oracle DOT com>. The following text is from the original log message: Reserve the pseudo keyword 'fallthrough' for the ability to convert the various case block /* fallthrough */ style comments to appear to be an actual reserved word with the same gcc case block missing fallthrough warning capability. All switch/case blocks now should end in one of: break; fallthrough; goto <label>; return [expression]; continue; In C mode, GCC supports the __fallthrough__ attribute since 7.1, the same time the warning and the comment parsing were introduced. Cygwin-only: add an explicit -Wimplicit-fallthrough=5 to the build flags.
Diffstat (limited to 'winsup/cygwin/fhandler_windows.cc')
-rw-r--r--winsup/cygwin/fhandler_windows.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler_windows.cc b/winsup/cygwin/fhandler_windows.cc
index c9ef66c..3a2119f 100644
--- a/winsup/cygwin/fhandler_windows.cc
+++ b/winsup/cygwin/fhandler_windows.cc
@@ -112,7 +112,7 @@ fhandler_windows::read (void *buf, size_t& len)
pthread::static_cancel_self ();
break;
}
- /*FALLTHRU*/
+ fallthrough;
case WAIT_OBJECT_0 + 2:
if (!PeekMessageW (ptr, hWnd_, 0, 0, PM_REMOVE))
{