Skip to content

Commit 220eaf1

Browse files
committed
semaphore: annotate fallthrough (NFC)
Address `-Werror,-Wimplicit-fallthrough` as identified by clang. This fixes a couple of build warnings which are treated as errors. NFC.
1 parent 90a45ce commit 220eaf1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/semaphore.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ _dispatch_semaphore_wait_slow(dispatch_semaphore_t dsema,
118118
}
119119
// Fall through and try to undo what the fast path did to
120120
// dsema->dsema_value
121-
case DISPATCH_TIME_NOW:
121+
__attribute__((__fallthrough__)) case DISPATCH_TIME_NOW:
122122
orig = dsema->dsema_value;
123123
while (orig < 0) {
124124
if (os_atomic_cmpxchgvw2o(dsema, dsema_value, orig, orig + 1,
@@ -128,7 +128,7 @@ _dispatch_semaphore_wait_slow(dispatch_semaphore_t dsema,
128128
}
129129
// Another thread called semaphore_signal().
130130
// Fall through and drain the wakeup.
131-
case DISPATCH_TIME_FOREVER:
131+
__attribute__((__fallthrough__)) case DISPATCH_TIME_FOREVER:
132132
_dispatch_sema4_wait(&dsema->dsema_sema);
133133
break;
134134
}

0 commit comments

Comments
 (0)