]> granicus.if.org Git - gc/commitdiff
Eliminate 'this statement may fall through' GCC warnings
authorIvan Maidanski <ivmai@mail.ru>
Wed, 29 Nov 2017 08:42:47 +0000 (11:42 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 15 Dec 2017 18:11:07 +0000 (21:11 +0300)
* 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
cord/tests/de.c
win32_threads.c

index 70bad9cdd13b36a742b94b4ee4f7896038524d6b..051e893052e234d4c39d5c22dd59f5d9efd45d38 100644 (file)
@@ -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':
index 2b467f22a5f9dbb27a8a822ebb161d07dd3676d3..1c00270bd81ecf96ec731c6abe5fdc46116eb0d9 100644 (file)
@@ -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 */
index 294acaded0482c8a31d90f5880f7b64dd7b3257a..58fa13374d9329ce267e0c1a1220cfe30c9e3e03 100644 (file)
@@ -2764,7 +2764,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();