From 7e8a04b35a0ff0487a76f84efcf311d2919ee07a Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 13 Jan 2025 09:36:48 -0500 Subject: [PATCH] eliminate a couple of build warnings (noticed with clang) 2025-01-12T19:08:53.4759829Z ../win/curses/cursinvt.c:191:5: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] 2025-01-12T19:08:53.4760198Z 191 | case KEY_RIGHT: 2025-01-12T19:08:53.4767986Z | ^ 2025-01-12T19:08:53.4967354Z ../win/curses/cursinvt.c:191:5: note: insert '__attribute__((fallthrough));' to silence this warning 2025-01-12T19:08:53.4967860Z 191 | case KEY_RIGHT: 2025-01-12T19:08:53.4968026Z | ^ 2025-01-12T19:08:53.4968219Z | __attribute__((fallthrough)); 2025-01-12T19:08:53.4968404Z ../win/curses/cursinvt.c:191:5: note: insert 'break;' to avoid fall-through 2025-01-12T19:08:53.4968583Z 191 | case KEY_RIGHT: 2025-01-12T19:08:53.4968709Z | ^ 2025-01-12T19:08:53.4968820Z | break; 2025-01-12T19:08:53.5099063Z 1 warning generated. 2025-01-12T19:08:53.8002074Z ../win/X11/winX.c:995:5: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] 2025-01-12T19:08:53.8008155Z 995 | case NHW_TEXT: 2025-01-12T19:08:53.8008513Z | ^ 2025-01-12T19:08:53.8032511Z ../win/X11/winX.c:995:5: note: insert '__attribute__((fallthrough));' to silence this warning 2025-01-12T19:08:53.8032899Z 995 | case NHW_TEXT: 2025-01-12T19:08:53.8033057Z | ^ 2025-01-12T19:08:53.8033219Z | __attribute__((fallthrough)); 2025-01-12T19:08:53.8033395Z ../win/X11/winX.c:995:5: note: insert 'break;' to avoid fall-through 2025-01-12T19:08:53.8033644Z 995 | case NHW_TEXT: 2025-01-12T19:08:53.8033783Z | ^ 2025-01-12T19:08:53.8033912Z | break; 2025-01-12T19:08:53.8800783Z 1 warning generated. --- win/X11/winX.c | 3 ++- win/curses/cursinvt.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/win/X11/winX.c b/win/X11/winX.c index d9a7cacf4..db95dea15 100644 --- a/win/X11/winX.c +++ b/win/X11/winX.c @@ -991,7 +991,8 @@ X11_putstr(winid window, int attr, const char *str) X11_destroy_nhwindow(window); *wp = window_list[new_win]; window_list[new_win].type = NHW_NONE; /* allow re-use */ - /* fall through */ + FALLTHROUGH; + /*FALLTHRU*/ case NHW_TEXT: add_to_text_window(wp, attr, str); break; diff --git a/win/curses/cursinvt.c b/win/curses/cursinvt.c index 3b0749d5c..4095ceb5a 100644 --- a/win/curses/cursinvt.c +++ b/win/curses/cursinvt.c @@ -187,6 +187,7 @@ curs_scroll_invt(WINDOW *win UNUSED) res = 1; break; } + FALLTHROUGH; /*FALLTHRU*/ case KEY_RIGHT: case KEY_NPAGE: