← Commit list

10cce8ae3

Denys Vlasenko
Denys Vlasenko
2023-06-18
SUCCESS Duration: 155s

Subject

shell/math: explain why we use separate &end

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

shell/math.c+1 -1
@@ -706,7 +706,7 @@ evaluate_string(arith_state_t *math_state, const char *expr)
char *end;
numstackptr->var_name = NULL;
errno = 0;
- end = (char*) expr; /* separate variable to go on stack */
+ /* code is smaller compared to using &expr here: */
numstackptr->val = strto_arith_t(expr, &end);
expr = end;
dbg("[%d] val:%lld", (int)(numstackptr - numstack), numstackptr->val);