Skip to content

Commit

Permalink
added skullc to clang tidy, added missing version
Browse files Browse the repository at this point in the history
  • Loading branch information
dosisod committed Aug 14, 2020
1 parent 038d3bd commit 2eba5af
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/clang_tidy.sh
Original file line number Diff line number Diff line change
@@ -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"
) ]]
2 changes: 1 addition & 1 deletion config.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SKULL_VERSION := 0.1.1
SKULL_VERSION := 0.2.1

INSTALL := /usr/local

Expand Down
4 changes: 4 additions & 0 deletions skull/common/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
#include <stdio.h>
#include <string.h>

#ifndef SKULL_VERSION
#define SKULL_VERSION "<version unknown>"
#endif

#define HANDLE_MAIN \
if (argc > 2) { \
puts("too many arguments passed, exiting"); \
Expand Down
4 changes: 0 additions & 4 deletions skull/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
#include "skull/eval/file.h"
#include "skull/eval/repl.h"

#ifndef SKULL_VERSION
#define SKULL_VERSION "<version unknown>"
#endif

/*
If no parameters are passed, run in interactive (repl) mode.
Expand Down
2 changes: 1 addition & 1 deletion skullc/llvm/aliases.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#define LLVM_INT(ctx, num) \
LLVMConstInt( \
LLVMInt64TypeInContext(ctx), \
(unsigned long long)num, \
(unsigned long long)(num), \
true \
)

Expand Down
2 changes: 1 addition & 1 deletion skullc/llvm/var.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>

#include <llvm-c/Core.h>

Expand Down
6 changes: 3 additions & 3 deletions skullc/main.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <errno.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>

#include "skull/common/main.h"
#include "skull/eval/repl.h"
Expand Down Expand Up @@ -47,15 +47,15 @@ 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) {
ll_filename[0] = '.';
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] = '.';
Expand Down

0 comments on commit 2eba5af

Please sign in to comment.