Skip to content

Commit b474be6

Browse files
[clang-tidy][NFC] Clarify switch-missing-default-case doc (#164699) (#164709)
Falling through a defaultless switch statement has well defined behavior. Fixes #164699. Credit for noticing this problem goes to user "pozz" on comp.lang.c, Message-ID: <[email protected]>
1 parent f5ac58f commit b474be6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang-tools-extra/docs/clang-tidy/checks/bugprone/switch-missing-default-case.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ on covering cases with non-enums where the compiler may not issue warnings.
99
Switch statements without a default case can lead to unexpected
1010
behavior and incomplete handling of all possible cases. When a switch statement
1111
lacks a default case, if a value is encountered that does not match any of the
12-
specified cases, the program will continue execution without any defined
13-
behavior or handling.
12+
specified cases, the switch statement will do nothing and the program will
13+
continue execution without handling the value.
1414

1515
This check helps identify switch statements that are missing a default case,
1616
allowing developers to ensure that all possible cases are handled properly.

0 commit comments

Comments
 (0)