diff --git a/.github/workflows/clang_tidy.sh b/.github/workflows/clang_tidy.sh index 3d1d2ed8..f4b55f69 100755 --- a/.github/workflows/clang_tidy.sh +++ b/.github/workflows/clang_tidy.sh @@ -1,7 +1,7 @@ [[ ! $(clang-tidy-9 \ - $(find -L {skull,test} -type f | grep -E "\.(c|h)$") \ + $(find -L {skull*,test} -type f | grep -E "\.(c|h)$") \ -checks=*,-llvm-header-guard,-readability-named-parameter,-google-readability-avoid-underscore-in-googletest-name,-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling \ -header-filter=.* \ -quiet -- \ - -std=c17 -I. 2>&1 | tee /dev/stderr | grep "skull" + -std=c17 -I. $(llvm-config-9 --cflags | awk '{print $1}') 2>&1 | tee /dev/stderr | grep "skull" ) ]] \ No newline at end of file diff --git a/config.mk b/config.mk index ccbdc48c..ecf777bd 100644 --- a/config.mk +++ b/config.mk @@ -1,4 +1,4 @@ -SKULL_VERSION := 0.1.1 +SKULL_VERSION := 0.2.1 INSTALL := /usr/local diff --git a/skull/common/main.h b/skull/common/main.h index 0260da3a..c6742aeb 100644 --- a/skull/common/main.h +++ b/skull/common/main.h @@ -2,6 +2,10 @@ #include #include +#ifndef SKULL_VERSION +#define SKULL_VERSION "" +#endif + #define HANDLE_MAIN \ if (argc > 2) { \ puts("too many arguments passed, exiting"); \ diff --git a/skull/main.c b/skull/main.c index 99c1c903..7ee9d51f 100644 --- a/skull/main.c +++ b/skull/main.c @@ -6,10 +6,6 @@ #include "skull/eval/file.h" #include "skull/eval/repl.h" -#ifndef SKULL_VERSION -#define SKULL_VERSION "" -#endif - /* If no parameters are passed, run in interactive (repl) mode. diff --git a/skullc/llvm/aliases.h b/skullc/llvm/aliases.h index c3e4a480..a7a4b6e3 100644 --- a/skullc/llvm/aliases.h +++ b/skullc/llvm/aliases.h @@ -1,7 +1,7 @@ #define LLVM_INT(ctx, num) \ LLVMConstInt( \ LLVMInt64TypeInContext(ctx), \ - (unsigned long long)num, \ + (unsigned long long)(num), \ true \ ) diff --git a/skullc/llvm/var.c b/skullc/llvm/var.c index aa348f34..f75022c3 100644 --- a/skullc/llvm/var.c +++ b/skullc/llvm/var.c @@ -1,5 +1,5 @@ -#include #include +#include #include diff --git a/skullc/main.c b/skullc/main.c index c22a1ca1..1695f263 100644 --- a/skullc/main.c +++ b/skullc/main.c @@ -1,7 +1,7 @@ #include #include -#include #include +#include #include "skull/common/main.h" #include "skull/eval/repl.h" @@ -47,7 +47,7 @@ int main(int argc, char *argv[]) { str_to_llvm_ir(repl_read_raw(f), builder, ctx); size_t len = strlen(argv[1]); - char *ll_filename = malloc(sizeof(char) * (len + 5)); + char *ll_filename = malloc(sizeof(char) * (len + 5)); // NOLINT char *slash_pos = strrchr(argv[1], '/'); if (!slash_pos) { @@ -55,7 +55,7 @@ int main(int argc, char *argv[]) { memcpy(ll_filename + 1, argv[1], len); } else { - long offset = (long)(slash_pos - argv[1]); + long offset = slash_pos - argv[1]; memcpy(ll_filename, argv[1], len); ll_filename[offset + 1] = '.';