~kennylevinsen/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch

[PATCH wlsunset 2/2 v2] main: pacify -Wimplicit-fallthrough with Clang >= 10

Jan Beich
Details
Message ID
<7dqu-ea9q-wny@FreeBSD.org>
DKIM signature
pass
Download raw message
Patch: +3 -1
../main.c:305:2: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
        case POLAR_NIGHT:
        ^
../main.c:305:2: note: insert '__attribute__((fallthrough));' to silence this warning
        case POLAR_NIGHT:
        ^
        __attribute__((fallthrough));
../main.c:305:2: note: insert 'break;' to avoid fall-through
        case POLAR_NIGHT:
        ^
        break;
1 error generated.
---
 main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/main.c b/main.c
index 4c27d58..49d6955 100644
--- a/main.c
+++ b/main.c
@@ -301,7 +301,9 @@ static time_t get_deadline_transition(const struct context *ctx, time_t now) {
		if (now < ctx->sun.sunrise) {
			return get_deadline_normal(ctx, now);
		}
		// fallthrough
#if __has_attribute(fallthrough)
		__attribute__((fallthrough));
#endif
	case POLAR_NIGHT:
		return tomorrow(now, -ctx->longitude_time_offset);
	default:
Reply to thread Export thread (mbox)