Skip to content

Commit c69955d

Browse files
authored
[RT] Remove assignment inside assert. (#6756)
- expressions in assert should ideally have no extra side effects. - Assert is a macro and can be disabled (to no op) by defining NDEBUG. Some build configurations define NDEBUG on release or optimized builds.
1 parent 99a56f3 commit c69955d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

OMCompiler/Compiler/runtime/settingsimpl.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ static void stripbinpath(char *omhome)
9191
}
9292

9393
do {
94-
assert(tmp = strrchr(omhome,'/'));
94+
tmp = strrchr(omhome,'/');
95+
assert(tmp);
9596
*tmp = '\0';
9697
} while (strcmp(tmp+1,"bin") && strcmp(tmp+1,"lib"));
9798
return;

0 commit comments

Comments
 (0)