Skip to content

Commit

Permalink
cppcheck: (error) Address of local auto-variable assigned
Browse files Browse the repository at this point in the history
Suppress autoVariables warnings in the lua interpreter.  The usage
here while unconventional in intentional and the same as upstream.

[module/lua/ldebug.c:327]: (error) Address of local auto-variable
    assigned to a function parameter.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#9732
  • Loading branch information
behlendorf authored and tonyhutter committed Dec 27, 2019
1 parent 5a9ab4b commit 6154c07
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions module/lua/ldebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ static void kname (Proto *p, int pc, int c, const char **name) {
if (ISK(c)) { /* is 'c' a constant? */
TValue *kvalue = &p->k[INDEXK(c)];
if (ttisstring(kvalue)) { /* literal constant? */
// cppcheck-suppress autoVariables
*name = svalue(kvalue); /* it is its own name */
return;
}
Expand Down
1 change: 1 addition & 0 deletions module/lua/ldo.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) {
struct lua_longjmp lj;
lj.status = LUA_OK;
lj.previous = L->errorJmp; /* chain new error handler */
// cppcheck-suppress autoVariables
L->errorJmp = &lj;
LUAI_TRY(L, &lj,
(*f)(L, ud);
Expand Down

0 comments on commit 6154c07

Please sign in to comment.