Skip to content

Commit

Permalink
Patch TSan complaint; Length check in test header write.
Browse files Browse the repository at this point in the history
  • Loading branch information
gitrj95 committed Mar 16, 2024
1 parent 412c285 commit e575e61
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test.h
Expand Up @@ -40,7 +40,7 @@
do { \
char buf__[BUFSIZ]; \
ptrdiff_t len__ = snprintf(buf__, BUFSIZ, "%s" fmt "%s\n", clr, KNRM); \
write((fd), buf__, len__); \
assert(len__ == write((fd), buf__, len__)); \
} while (0)

#define suite() pr(STDOUT_FILENO, "Suite: " __FILE__, KCYN)
Expand Down
4 changes: 2 additions & 2 deletions test/Makefile
Expand Up @@ -8,7 +8,7 @@ DELIM = echo "~~"
ASAN = -fsanitize=address
UBSAN = -fsanitize=undefined
TSAN = -fsanitize=thread
CFLAGS = -std=$(STD) -Wall -Wextra -Wconversion -Wno-sign-conversion -Wdouble-promotion -Wcast-qual -Wvla -Werror -pedantic -O0 -g3 -DNCOLOR=$(NCOLOR) -fpie
CFLAGS = -std=$(STD) -Wall -Wextra -Wconversion -Wno-sign-conversion -Wdouble-promotion -Wcast-qual -Wvla -Werror -pedantic -g3 -DNCOLOR=$(NCOLOR) -fpie
LDFLAGS = -Wl,-pie

check: test_arena test_spinlock test_msi
Expand All @@ -21,7 +21,7 @@ test_arena: arena
arena: arena.c .force
$(CC) -o $@ $(CFLAGS) $(ASAN) $(UBSAN) $< $(LDFLAGS)

test_spinlock: spinlock_tsan spinlock_asan
test_spinlock: spinlock_asan
@$(DELIM)
@echo "[Under TSan]"
@./spinlock_tsan
Expand Down

0 comments on commit e575e61

Please sign in to comment.