Skip to content

Commit

Permalink
checker: minor formats to checker portion of makefile, add some test …
Browse files Browse the repository at this point in the history
…to the checker file
  • Loading branch information
gforney committed Jan 20, 2025
1 parent 39dad17 commit 87ca88c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
17 changes: 8 additions & 9 deletions Build/smokeview/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ obj = $(cobj) $(cppobj)

# setup for analyzing smokeview source code using clang

cclang = $(csrc:.c=.chk)
cppclang = $(cppsrc:.cpp=.chk)
clangchk = $(cclang) $(cppclang)
linux_osx_c_chk = $(csrc:.c=.chk)
linux_osx_cpp_chk = $(cppsrc:.cpp=.chk)
linux_osx_chk = $(linux_osx_c_chk) $(linux_osx_cpp_chk)

wincclang = $(csrc:.c=.winchk)
wincppclang = $(cppsrc:.cpp=.winchk)
winclangchk = $(wincclang) $(wincppclang)
win_c_chk = $(csrc:.c=.winchk)
win_cpp_chk = $(cppsrc:.cpp=.winchk)
win_chk = $(win_c_chk) $(win_cpp_chk)

#CLANGANALYZE=clang --analyze -Xanalyzer -analyzer-checker=core,deadcode
CLANGANALYZE=clang --analyze
Expand Down Expand Up @@ -394,15 +394,14 @@ gnu_linux_64_check : $(src)
# ------------- linux_osx_check ----------------

linux_osx_check : CFLAGS =
linux_osx_check : $(clangchk)
linux_osx_check : $(linux_osx_chk)
$(CLANGSUMMARY) smokeview.summary

# ------------- win_check ----------------
# (not working yet)

win_check : CFLAGS = -D NDEBUG -D WIN32 -D _CONSOLE -D X64 -D GLEW_STATIC -D PTW32_STATIC_LIB
win_check : INC += $(WININC)
win_check : $(winclangchk)
win_check : $(win_chk)
$(CLANGWINSUMMARY) smokeview.summary

# VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
Expand Down
7 changes: 5 additions & 2 deletions Source/smokeview/clang_test.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "options.h"
//#define pp_CLANG_TEST
#ifdef pp_CLANG_TEST
#include <assert.h>
#include <stdlib.h>
Expand All @@ -19,9 +18,13 @@ b=1/a;
//use undefined value
c=c+d;

//access array
//access NULL array
c=array[0];

//access undefined array
d=barray[0];

//access undefined array position
e=carray[0];

return;
Expand Down

0 comments on commit 87ca88c

Please sign in to comment.