add clang-tidy to check for possible errors.

This commit is contained in:
NunoSempere 2023-08-19 19:18:02 +02:00
parent 0c22716635
commit 827fa3823b
3 changed files with 3 additions and 1 deletions

Binary file not shown.

View File

@ -17,3 +17,5 @@ format: squiggle.c squiggle.h
$(FORMATTER) squiggle.c $(FORMATTER) squiggle.c
$(FORMATTER) squiggle.h $(FORMATTER) squiggle.h
lint:
clang-tidy squiggle.c -- -lm

View File

@ -217,7 +217,7 @@ struct box process_error(const char* error_msg, int should_exit, char* file, int
exit(1); exit(1);
} else { } else {
char error_msg[MAX_ERROR_LENGTH]; char error_msg[MAX_ERROR_LENGTH];
snprintf(error_msg, MAX_ERROR_LENGTH, "@, in %s (%d)", file, line); snprintf(error_msg, MAX_ERROR_LENGTH, "@, in %s (%d)", file, line); // NOLINT: We are being carefull here by considering MAX_ERROR_LENGTH explicitly.
struct box error = { .empty = 1, .error_msg = error_msg }; struct box error = { .empty = 1, .error_msg = error_msg };
return error; return error;
} }