mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-09 10:06:20 -05:00
config: Remove some "UNREACHABLE" UB footguns
Every branch of these long if/else if/else chains returns, so the compiler can figure out on its own that the last line is never reached. If, for some reason, one of the branches does not return (as was the case after205f1f7, fixed byb22322b), this would usually result in a compiler error ("control reaches end of non-void function"), but adding UNREACHABLE transforms this into silent undefined behaviour.
This commit is contained in:
parent
d70a21355c
commit
02bb2768f1
1 changed files with 0 additions and 4 deletions
4
config.c
4
config.c
|
|
@ -1012,8 +1012,6 @@ parse_section_main(struct context *ctx)
|
|||
LOG_CONTEXTUAL_ERR("not a valid option: %s", key);
|
||||
return false;
|
||||
}
|
||||
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
@ -2340,8 +2338,6 @@ parse_section_tweak(struct context *ctx)
|
|||
LOG_CONTEXTUAL_ERR("not a valid option: %s", key);
|
||||
return false;
|
||||
}
|
||||
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue