]> 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>
Mon, 18 Dec 2017 07:22:20 +0000 (10:22 +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 a33e3f3b6afc3be4f3bfd86d4a6f05eecc0ce2ea..f22bd7449aee9c21181ba9bc009564bccb19d387 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 403dcaeeaca9505ef2847307465d6ff58c8f44d8..67d0a11865c88a5b1822753d5143c7f51b013e20 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 cccb6c9048c35f946c8fc5bf00ccbd039221a129..d953162387dac4cc0e4289ad2b1f35867bca15d2 100644 (file)
@@ -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();