Skip to content

Commit 54782c7

Browse files
author
Craig Ringer
committed
Fix cflags in scan-build stack escape checking
1 parent ce8f45b commit 54782c7

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

c/clang_return_stack_checks/Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,21 @@ ifeq ($(origin CC),default)
22
CC = scan-build clang
33
endif
44

5-
ifeq ($(origin CFLAGS),default)
6-
CFLAGS = -Wall -Wextra
5+
ifeq ($(origin CFLAGS),undefined)
6+
CFLAGS = -Wall -Wextra -Og -ggdb3
77
endif
88

99
all: return_stack_escape
1010

1111
guard.so: guard.c guard.h
12-
$(CC) -shared -fPIC $< -o $@
12+
$(CC) $(CFLAGS) -shared -fPIC $< -o $@
1313

1414
return_stack_escape: return_stack_escape.c guard.so
15-
$(CC) $< ./guard.so -o $@
15+
$(CC) $(CFLAGS) $< ./guard.so -o $@
1616

1717
clean:
1818
rm -f guard.so return_stack_escape
19+
20+
run:
21+
./return_stack_escape 0
22+
if ./return_stack_escape; then exit 1; fi

0 commit comments

Comments
 (0)