Skip to content

Commit aeb9a91

Browse files
committed
Add annotations in a few places to silence some warnings
1 parent 9d21a09 commit aeb9a91

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/lcorolib.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ static int luaB_close (lua_State *L) {
226226
if (lua_tothread(L, -1) == co)
227227
return luaL_error(L, "cannot close main thread");
228228
lua_closethread(co, L); /* close itself */
229-
/* previous call does not return *//* FALLTHROUGH */
229+
/* previous call does not return */SOUP_UNREACHABLE;
230230
default:
231231
lua_assert(0);
232232
return 0;

src/lparser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ static void check_readonly (LexState *ls, expdesc *e) {
974974
case VVARGIND: {
975975
needvatab(fs->f); /* function will need a vararg table */
976976
e->k = VINDEXED;
977-
} /* FALLTHROUGH */
977+
} [[fallthrough]];
978978
case VINDEXUP: case VINDEXSTR: case VINDEXED: { /* global variable */
979979
if (e->u.ind.ro) /* read-only? */
980980
varname = tsvalue(&fs->f->k[e->u.ind.keystr]);
@@ -6272,7 +6272,7 @@ static void statement (LexState *ls, tdn_t *nprop, TypeHint *prop) {
62726272
} /* else... */
62736273
}
62746274
#endif
6275-
/* FALLTHROUGH */
6275+
[[fallthrough]];
62766276
default: { /* stat -> func | assignment */
62776277
exprstat(ls);
62786278
break;

src/luac.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,7 @@ static void PrintCode(const Proto* f)
685685
case OP_EXTRAARG:
686686
printf("%d",ax);
687687
break;
688+
case NUM_OPCODES: [[unreachable]];
688689
#if 0
689690
default:
690691
printf("%d %d %d",a,b,c);

0 commit comments

Comments
 (0)