-
Notifications
You must be signed in to change notification settings - Fork 94
Open
Description
severe warning from gcc 13 - this code exports a local variable res into upper js struct.
cc -O3 -DNDEBUG -fstack-protector -Wall -Werror -std=c99 -c -o elk.o elk.c elk.c: In function ‘js_eval’: elk.c:1396:12: error: storing the address of local variable ‘res’ in ‘*js.cstk’ [-Werror=dangling-pointer=] 1396 | js->cstk = &res; | ~~~~~~~~~^~~~~~ elk.c:1389:11: note: ‘res’ declared here 1389 | jsval_t res = js_mkundef(); | ^~~ elk.c:1387:28: note: ‘js’ declared here 1387 | jsval_t js_eval(struct js *js, const char *buf, size_t len) { | ~~~~~~~~~~~^~ cc1: all warnings being treated as errors make[2]: *** [: elk.o] Error 1
Metadata
Metadata
Assignees
Labels
No labels