This is the mail archive of the cygwin-cvs@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[newlib-cygwin] Add comments to intentional switch fallthroughs


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=5d09711b1d17ac29cbdc7c6c2f3812c93334a933

commit 5d09711b1d17ac29cbdc7c6c2f3812c93334a933
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Thu Nov 24 10:51:32 2016 +0100

    Add comments to intentional switch fallthroughs
    
    Clarify Coverity "Missing break in switch" messages.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/fhandler_tty.cc | 1 +
 winsup/cygwin/sigproc.cc      | 2 ++
 winsup/cygwin/smallprint.cc   | 4 ++++
 3 files changed, 7 insertions(+)

diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index aba469f..1505b8c 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -617,6 +617,7 @@ fhandler_pty_slave::write (const void *ptr, size_t len)
 	{
 	case ERROR_NO_DATA:
 	  err = ERROR_IO_DEVICE;
+	  /*FALLTHRU*/
 	default:
 	  __seterrno_from_win_error (err);
 	}
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index 60c931d..36fc649 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -1357,8 +1357,10 @@ wait_sig (VOID *)
 	    sig_clear (-pack.si.si_signo);
 	  else
 	    sigq.add (pack);
+	  /*FALLTHRU*/
 	case __SIGNOHOLD:
 	  sig_held = false;
+	  /*FALLTHRU*/
 	case __SIGFLUSH:
 	case __SIGFLUSHFAST:
 	  if (!sig_held)
diff --git a/winsup/cygwin/smallprint.cc b/winsup/cygwin/smallprint.cc
index ff71a36..3cec31c 100644
--- a/winsup/cygwin/smallprint.cc
+++ b/winsup/cygwin/smallprint.cc
@@ -169,6 +169,7 @@ __small_vsprintf (char *dst, const char *fmt, va_list ap)
 		      pad = '0';
 		      continue;
 		    }
+		  /*FALLTHRU*/
 		case '1': case '2': case '3': case '4':
 		case '5': case '6': case '7': case '8': case '9':
 		  len = len * 10 + (c - '0');
@@ -284,6 +285,7 @@ gen_decimalLL:
 		  n = strtol (fmt, (char **) &fmt, 10);
 		  if (*fmt++ != 's')
 		    goto endfor;
+		  /*FALLTHRU*/
 		case 's':
 		  s = va_arg (ap, char *);
 		  if (s == NULL)
@@ -511,6 +513,7 @@ __small_vswprintf (PWCHAR dst, const WCHAR *fmt, va_list ap)
 		      pad = L'0';
 		      continue;
 		    }
+		  /*FALLTHRU*/
 		case L'1' ... L'9':
 		  len = len * 10 + (c - L'0');
 		  continue;
@@ -612,6 +615,7 @@ gen_decimalLL:
 		  n = wcstoul (fmt, (wchar_t **) &fmt, 10);
 		  if (*fmt++ != L's')
 		    goto endfor;
+		  /*FALLTHRU*/
 		case L's':
 		  s = va_arg (ap, char *);
 		  if (s == NULL)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]