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>
Wed, 29 Nov 2017 10:01:47 +0000 (13:01 +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 70bad9c..051e893 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 2b467f2..1c00270 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 a8ac09d..4f15ca1 100644 (file)
@@ -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();