From: Ivan Maidanski Date: Wed, 29 Nov 2017 08:42:47 +0000 (+0300) Subject: Eliminate 'this statement may fall through' GCC warnings X-Git-Tag: v7.4.8~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d0ca8e507bdceec72ee438d841f8eb3c291ab2eb;p=gc 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. --- diff --git a/cord/cordprnt.c b/cord/cordprnt.c index a33e3f3b..f22bd744 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 403dcaee..67d0a118 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 cccb6c90..d9531623 100644 --- a/win32_threads.c +++ b/win32_threads.c @@ -2709,7 +2709,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();