Commit 258f79d5 authored by Heinrich Schuchardt's avatar Heinrich Schuchardt Committed by Linus Torvalds

scripts/ avoid false warning missing break

void foo(int a)
	switch (a) {
	case 'h':

creates a warning "Possible switch case/default not preceded by break or
fallthrough comment".

exit( should be treated like return.

Link: default avatarHeinrich Schuchardt <>
Acked-by: default avatarJoe Perches <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 25bdda2b
......@@ -6109,7 +6109,7 @@ sub process {
next if ($fline =~ /^.[\s$;]*$/);
$has_statement = 1;
$has_break = 1 if ($fline =~ /\bswitch\b|\b(?:break\s*;[\s$;]*$|return\b|goto\b|continue\b)/);
$has_break = 1 if ($fline =~ /\bswitch\b|\b(?:break\s*;[\s$;]*$|exit\s*\(\b|return\b|goto\b|continue\b)/);
if (!$has_break && $has_statement) {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment