From 07feeaa568096c917bb61d69dde79e6a2511cf3f Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 29 Nov 2017 11:42:47 +0300 Subject: [PATCH] Eliminate 'this statement may fall through' GCC warnings * cord/cordprnt.c (extract_conv_spec): Eliminate fall through in a switch statement. * cord/tests/de.c (do_command): Replace "fall through:" comment with "FALLTHRU" formal comment (on a new line). * win32_threads.c [!GC_PTHREADS && !GC_NO_THREADS_DISCOVERY] (GC_DllMain): Likewise. --- cord/cordprnt.c | 4 +++- cord/tests/de.c | 2 +- win32_threads.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cord/cordprnt.c b/cord/cordprnt.c index 70bad9c..051e893 100644 --- a/cord/cordprnt.c +++ b/cord/cordprnt.c @@ -92,7 +92,9 @@ static int extract_conv_spec(CORD_pos source, char *buf, if (!saw_number) { /* Zero fill flag; ignore */ break; - } /* otherwise fall through: */ + } + current_number *= 10; + break; case '1': case '2': case '3': diff --git a/cord/tests/de.c b/cord/tests/de.c index 2b467f2..1c00270 100644 --- a/cord/tests/de.c +++ b/cord/tests/de.c @@ -492,7 +492,7 @@ void do_command(int c) break; } col--; file_pos--; - /* fall through: */ + /* FALLTHRU */ case DEL: if (file_pos == current_len-1) break; /* Can't delete trailing newline */ diff --git a/win32_threads.c b/win32_threads.c index a8ac09d..4f15ca1 100644 --- a/win32_threads.c +++ b/win32_threads.c @@ -2768,7 +2768,8 @@ GC_INNER void GC_thr_init(void) } # endif GC_ASSERT(entry_count == 0 || parallel_initialized); - ++entry_count; /* and fall through: */ + ++entry_count; + /* FALLTHRU */ case DLL_PROCESS_ATTACH: /* This may run with the collector uninitialized. */ thread_id = GetCurrentThreadId(); -- 2.7.4