tests/test-char: Use a proper fallthrough comment
PATCH 1/1 tests/test-char: Use a proper fallthrough comment
For being able to compile with -Werror=implicit-fallthrough we need to use comments that the compiler recognizes. Use "fallthrough" instead of "no break" here.
--- tests/test-char.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/test-char.c +1 -1
@@ -70,7 +70,7 @@ static void fe_event(void *opaque, QEMUChrEvent event) h->openclose_mismatch = true; } h->is_open = new_open_state; -/* no break */ +/* fallthrough */ default : quit = true;break ;
Signature · 1 line
2.18.2
Quoted 6 lines · Thomas Huth
For being able to compile with -Werror=implicit-fallthrough we need to use comments that the compiler recognizes. Use "fallthrough" instead of "no break" here.
Signed-off-by Thomas Huth <[email protected]>
---
Quoted 21 lines
tests/test-char.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/test-char.c +1
-2@@ -70,7 +70,7 @@ static void fe_event(void *opaque, QEMUChrEvent event) h->openclose_mismatch = true; } h->is_open = new_open_state; -/* no break */ +/* fallthrough */ default : quit = true;break ; --2.18.2
Signature · 1 line
Marc-André Lureau
Quoted 15 lines · Thomas Huth
For being able to compile with -Werror=implicit-fallthrough we need to use comments that the compiler recognizes. Use "fallthrough" instead of "no break" here.
Signed-off-by Thomas Huth <[email protected]>--- tests/test-char.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/test-char.c +0
-0
tests/test-char.c static void fe_event(void *opaque, QEMUChrEvent event) · line 76
Quoted 8 lines
tests/test-char.c +1
-1@@ -70,7 +70,7 @@ static void fe_event(void *opaque, QEMUChrEvent event) h->openclose_mismatch = true; } h->is_open = new_open_state; -/* no break */ +/* fallthrough */ default : quit = true;break ;
Laurent Vivier
AppliedLe 02/10/2020 à 19:13, Thomas Huth a écrit :
Quoted 15 lines
For being able to compile with -Werror=implicit-fallthrough we need to use comments that the compiler recognizes. Use "fallthrough" instead of "no break" here.
Signed-off-by Thomas Huth <[email protected]>--- tests/test-char.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/test-char.c +0
-0
tests/test-char.c static void fe_event(void *opaque, QEMUChrEvent event) · line 76
Quoted 8 lines
tests/test-char.c +1
-1@@ -70,7 +70,7 @@ static void fe_event(void *opaque, QEMUChrEvent event) h->openclose_mismatch = true; } h->is_open = new_open_state; -/* no break */ +/* fallthrough */ default : quit = true;break ;
Applied to my trivial-patches branch.
Thanks,
Laurent