-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: clang-tidy checks #39
base: main
Are you sure you want to change the base?
Conversation
probe_src/arena/arena.c
Outdated
#define memcpy_s(dest, destsz, src, count) | ||
#define snprintf_s(buffer, sizeOfBuffer, count, ...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the point of these two macros?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy
was giving warnings that memcpy
and snprintf
aren't secure, so to remove those added memcpy_s
and snprintf_s
. These two aren't defined on non-window environments so had to define them as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like you're defining them as nothing "replace memcpy_s(a, b, c, d)
with the empty-string".
Maybe we should define memcpy_s(a, b, c, d)
as memcpy(a, c, d)
?
Justfile
Outdated
check-clang-tidy: | ||
clang-tidy probe_src/**/*.c -- -Iinclude | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also check .h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah,, will do this
probe_src/libprobe/src/util.c
Outdated
#include <stdio.h> | ||
#include <stdlib.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there another CI tool we can bring in to eliminate unneeded includes? If we delete a function in util.c
it may cause the include to be unneeded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will check this
probe_src/libprobe/src/fd_table.c
Outdated
#include <pthread.h> | ||
#include <assert.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's just remove this file; it is no longer included in the build.
I've pushed some work on resolving the clang-tidy warnings (mostly by restructuring |
Oh, I cloned the repo again yesterday and started all over again lol, will try to push some additional changes today |
1ebd977
to
e916070
Compare
clang-tidy
in the CI setup.clang-tidy
inarena.c
andtest_arena.c