Selaa lähdekoodia

Enable -Wimplicit-fallthrough.

Andreas Kling 6 vuotta sitten
vanhempi
commit
df6aaaeeef

+ 1 - 1
Applications/About/Makefile

@@ -6,7 +6,7 @@ APP = About
 ARCH_FLAGS =
 STANDARD_FLAGS = -std=c++17 -nostdinc++ -nostdlib -nostdinc
 USERLAND_FLAGS = -ffreestanding -fno-stack-protector -fno-ident
-WARNING_FLAGS = -Wextra -Wall -Wundef -Wcast-qual -Wwrite-strings
+WARNING_FLAGS = -Wextra -Wall -Wundef -Wcast-qual -Wwrite-strings -Wimplicit-fallthrough
 FLAVOR_FLAGS = -march=i386 -m32 -fno-exceptions -fno-rtti -fmerge-all-constants -fno-unroll-loops -fno-pie -fno-pic
 OPTIMIZATION_FLAGS = -Oz -fno-asynchronous-unwind-tables
 INCLUDE_FLAGS = -I../.. -I. -I../../LibC

+ 1 - 1
Applications/Clock/Makefile

@@ -7,7 +7,7 @@ APP = Clock
 ARCH_FLAGS =
 STANDARD_FLAGS = -std=c++17 -nostdinc++ -nostdlib -nostdinc
 USERLAND_FLAGS = -ffreestanding -fno-stack-protector -fno-ident
-WARNING_FLAGS = -Wextra -Wall -Wundef -Wcast-qual -Wwrite-strings
+WARNING_FLAGS = -Wextra -Wall -Wundef -Wcast-qual -Wwrite-strings -Wimplicit-fallthrough
 FLAVOR_FLAGS = -march=i386 -m32 -fno-exceptions -fno-rtti -fmerge-all-constants -fno-unroll-loops -fno-pie -fno-pic
 OPTIMIZATION_FLAGS = -Oz -fno-asynchronous-unwind-tables
 INCLUDE_FLAGS = -I../.. -I. -I../../LibC

+ 1 - 1
Applications/FileManager/Makefile

@@ -7,7 +7,7 @@ APP = FileManager
 ARCH_FLAGS =
 STANDARD_FLAGS = -std=c++17 -nostdinc++ -nostdlib -nostdinc
 USERLAND_FLAGS = -ffreestanding -fno-stack-protector -fno-ident
-WARNING_FLAGS = -Wextra -Wall -Wundef -Wcast-qual -Wwrite-strings
+WARNING_FLAGS = -Wextra -Wall -Wundef -Wcast-qual -Wwrite-strings -Wimplicit-fallthrough
 FLAVOR_FLAGS = -march=i386 -m32 -fno-exceptions -fno-rtti -fmerge-all-constants -fno-unroll-loops -fno-pie -fno-pic
 OPTIMIZATION_FLAGS = -Oz -fno-asynchronous-unwind-tables
 INCLUDE_FLAGS = -I../.. -I. -I../../LibC

+ 1 - 1
Applications/FontEditor/Makefile

@@ -7,7 +7,7 @@ APP = FontEditor
 ARCH_FLAGS =
 STANDARD_FLAGS = -std=c++17 -nostdinc++ -nostdlib -nostdinc
 USERLAND_FLAGS = -ffreestanding -fno-stack-protector -fno-ident
-WARNING_FLAGS = -Wextra -Wall -Wundef -Wcast-qual -Wwrite-strings
+WARNING_FLAGS = -Wextra -Wall -Wundef -Wcast-qual -Wwrite-strings -Wimplicit-fallthrough
 FLAVOR_FLAGS = -march=i386 -m32 -fno-exceptions -fno-rtti -fmerge-all-constants -fno-unroll-loops -fno-pie -fno-pic
 OPTIMIZATION_FLAGS = -Oz -fno-asynchronous-unwind-tables
 INCLUDE_FLAGS = -I../.. -I. -I../../LibC

+ 1 - 1
Applications/Launcher/Makefile

@@ -6,7 +6,7 @@ APP = Launcher
 ARCH_FLAGS =
 STANDARD_FLAGS = -std=c++17 -nostdinc++ -nostdlib -nostdinc
 USERLAND_FLAGS = -ffreestanding -fno-stack-protector -fno-ident
-WARNING_FLAGS = -Wextra -Wall -Wundef -Wcast-qual -Wwrite-strings
+WARNING_FLAGS = -Wextra -Wall -Wundef -Wcast-qual -Wwrite-strings -Wimplicit-fallthrough
 FLAVOR_FLAGS = -march=i386 -m32 -fno-exceptions -fno-rtti -fmerge-all-constants -fno-unroll-loops -fno-pie -fno-pic
 OPTIMIZATION_FLAGS = -Oz -fno-asynchronous-unwind-tables
 INCLUDE_FLAGS = -I../.. -I. -I../../LibC

+ 1 - 1
Applications/Terminal/Makefile

@@ -7,7 +7,7 @@ APP = Terminal
 ARCH_FLAGS =
 STANDARD_FLAGS = -std=c++17 -nostdinc++ -nostdlib -nostdinc
 USERLAND_FLAGS = -ffreestanding -fno-stack-protector -fno-ident
-WARNING_FLAGS = -Wextra -Wall -Wundef -Wcast-qual -Wwrite-strings
+WARNING_FLAGS = -Wextra -Wall -Wundef -Wcast-qual -Wwrite-strings -Wimplicit-fallthrough
 FLAVOR_FLAGS = -march=i386 -m32 -fno-exceptions -fno-rtti -fmerge-all-constants -fno-unroll-loops -fno-pie -fno-pic
 OPTIMIZATION_FLAGS = -Oz -fno-asynchronous-unwind-tables
 INCLUDE_FLAGS = -I../.. -I. -I../../LibC

+ 1 - 1
Kernel/Makefile

@@ -85,7 +85,7 @@ IMAGE = .floppy-image
 ARCH_FLAGS =
 STANDARD_FLAGS = -std=c++17 -nostdinc++ -nostdlib -nostdinc
 KERNEL_FLAGS = -ffreestanding -fno-stack-protector -fno-ident -fno-builtin
-WARNING_FLAGS = -Wextra -Wall -Wundef -Wcast-qual -Wwrite-strings
+WARNING_FLAGS = -Wextra -Wall -Wundef -Wcast-qual -Wwrite-strings -Wimplicit-fallthrough
 FLAVOR_FLAGS = -mregparm=3 -march=i386 -m32 -fno-exceptions -fno-rtti -fmerge-all-constants -fno-unroll-loops -fno-pie -fno-pic
 OPTIMIZATION_FLAGS = -Oz -fno-asynchronous-unwind-tables -fno-omit-frame-pointer
 INCLUDE_FLAGS = -I.. -I.

+ 2 - 2
Kernel/VirtualConsole.cpp

@@ -417,14 +417,14 @@ void VirtualConsole::on_char(byte ch)
             return;
         }
         m_escape_state = ExpectIntermediate;
-        // fall through
+        [[fallthrough]];
     case ExpectIntermediate:
         if (is_valid_intermediate_character(ch)) {
             m_intermediates.append(ch);
             return;
         }
         m_escape_state = ExpectFinal;
-        // fall through
+        [[fallthrough]];
     case ExpectFinal:
         if (is_valid_final_character(ch)) {
             m_escape_state = Normal;

+ 1 - 1
LibC/Makefile

@@ -55,7 +55,7 @@ LIBRARY = LibC.a
 ARCH_FLAGS =
 STANDARD_FLAGS = -std=c++17 -nostdinc++ -nostdlib -nostdinc
 LIBC_FLAGS = -ffreestanding -fno-stack-protector -fno-ident
-WARNING_FLAGS = -Wextra -Wall -Wundef -Wcast-qual -Wwrite-strings
+WARNING_FLAGS = -Wextra -Wall -Wundef -Wcast-qual -Wwrite-strings -Wimplicit-fallthrough
 FLAVOR_FLAGS = -fomit-frame-pointer -march=i386 -m32 -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -fmerge-all-constants -fno-unroll-loops -fno-pie -fno-pic
 OPTIMIZATION_FLAGS = -O2 -fno-asynchronous-unwind-tables
 INCLUDE_FLAGS = -I.. -I.

+ 1 - 1
LibGUI/Makefile

@@ -37,7 +37,7 @@ LIBRARY = LibGUI.a
 ARCH_FLAGS =
 STANDARD_FLAGS = -std=c++17 -nostdinc++ -nostdlib -nostdinc
 LIBC_FLAGS = -ffreestanding -fno-stack-protector -fno-ident
-WARNING_FLAGS = -Wextra -Wall -Wundef -Wcast-qual -Wwrite-strings
+WARNING_FLAGS = -Wextra -Wall -Wundef -Wcast-qual -Wwrite-strings -Wimplicit-fallthrough
 FLAVOR_FLAGS = -fomit-frame-pointer -march=i386 -m32 -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -fmerge-all-constants -fno-unroll-loops -fno-pie -fno-pic
 OPTIMIZATION_FLAGS = -Oz -fno-asynchronous-unwind-tables
 INCLUDE_FLAGS = -I../LibC -I.. -I.

+ 1 - 1
Userland/Makefile

@@ -64,7 +64,7 @@ APPS = \
 ARCH_FLAGS =
 STANDARD_FLAGS = -std=c++17 -nostdinc++ -nostdlib -nostdinc
 USERLAND_FLAGS = -ffreestanding -fno-stack-protector -fno-ident
-WARNING_FLAGS = -Wextra -Wall -Wundef -Wcast-qual -Wwrite-strings
+WARNING_FLAGS = -Wextra -Wall -Wundef -Wcast-qual -Wwrite-strings -Wimplicit-fallthrough
 FLAVOR_FLAGS = -march=i386 -m32 -fno-exceptions -fno-rtti -fmerge-all-constants -fno-unroll-loops -fno-pie -fno-pic
 OPTIMIZATION_FLAGS = -Oz -fno-asynchronous-unwind-tables
 INCLUDE_FLAGS = -I.. -I. -I../LibC