re-enable -Wunreachable-code under clang
whitelist the valid cases showing up If an earlier version of clang is showing more cases (particularly if they don't make sense), the re-enabling of the warning in sys/unix/hints/include/compiler.2020 can be made clang-version specific instead. I had no way to test earlier versions.
This commit is contained in:
@@ -923,7 +923,10 @@ set_savefile_name(boolean regularize_it)
|
||||
overflow = 2;
|
||||
}
|
||||
#ifdef SAVE_EXTENSION
|
||||
if (strlen(SAVE_EXTENSION) > 0 && !overflow) {
|
||||
/* (0) is placed in brackets below so that the [&& !overflow] is
|
||||
explicit dead code (the ">" comparison is detected as always
|
||||
FALSE at compile-time). Done to appease clang's -Wunreachable-code */
|
||||
if (strlen(SAVE_EXTENSION) > (0) && !overflow) {
|
||||
if (strlen(g.SAVEF) + strlen(SAVE_EXTENSION) < (SAVESIZE - 1)) {
|
||||
Strcat(g.SAVEF, SAVE_EXTENSION);
|
||||
#ifdef MSDOS
|
||||
|
||||
Reference in New Issue
Block a user