Skip to content

Commit c04c110

Browse files
committed
Addressed code review comments
handle error
1 parent ff3d36f commit c04c110

2 files changed

Lines changed: 16 additions & 12 deletions

File tree

Makefile

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,19 @@ examples:
1818
SCAN_DIR = ./scan_out
1919

2020
scan_result_check:
21-
@num=$$(grep -h -o '^[0-9]\+ warnings\? generated' ./$(SCAN_DIR)/*.log | grep -o '^[0-9]\+' | awk '{s+=$$1} END {print s}');\
22-
if [ -z "$$num" ]; then \
23-
echo "no warnings found";\
24-
exit 0; \
21+
@err=$$(grep -h -o 'error: .*' ./$(SCAN_DIR)/*.log | wc -l); \
22+
if [ -z "$$err" ]; then \
23+
err=0; \
24+
fi; \
25+
wrn=$$(grep -h -o '^[0-9]\+ warnings\? generated' ./$(SCAN_DIR)/*.log | grep -o '^[0-9]\+' | awk '{s+=$$1} END {print s}');\
26+
if [ -z "$$wrn" ]; then \
27+
wrn=0; \
2528
fi; \
26-
if [ $$num -ne 0 ]; then \
27-
echo "scan-build found $$num warnings";\
29+
if [ $$err -eq 0 -a $$wrn -eq 0 ]; then \
30+
echo "no errors or warnings found";\
31+
exit 0; \
32+
else\
33+
echo "scan-build detected $$err errors and $$wrn warnings";\
2834
for f in $(SCAN_DIR)/*.log; do \
2935
echo "---- $$f ----"; \
3036
cat $$f; \

tools/whnvmtool/Makefile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,13 @@ WOLFCRYPT_SRC = \
2727
$(WOLFSSL_DIR)/wolfcrypt/src/ecc.c \
2828
$(WOLFSSL_DIR)/wolfcrypt/src/cmac.c
2929

30-
ifneq ($(NOCRYPTO),1)
31-
SRC = \
32-
$(WOLFHSM_SRC) \
33-
$(WOLFCRYPT_SRC) \
34-
$(TARGET).c
35-
else
3630
SRC = \
3731
$(WOLFHSM_SRC) \
3832
$(TARGET).c
33+
34+
ifneq ($(NOCRYPTO),1)
35+
SRC += \
36+
$(WOLFCRYPT_SRC)
3937
endif
4038

4139
ifeq ($(SCAN),1)

0 commit comments

Comments
 (0)