Skip to content
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

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

saleha-muzammil
Copy link
Contributor

  • Added clang-tidy in the CI setup.
  • Fixed bugs related to clang-tidy in arena.c and test_arena.c

@saleha-muzammil saleha-muzammil changed the title fix: clnag-tidy checks fix: clang-tidy checks Jul 26, 2024
Comment on lines 23 to 24
#define memcpy_s(dest, destsz, src, count)
#define snprintf_s(buffer, sizeOfBuffer, count, ...)
Copy link
Owner

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?

Copy link
Contributor Author

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

Copy link
Owner

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
Comment on lines 20 to 22
check-clang-tidy:
clang-tidy probe_src/**/*.c -- -Iinclude

Copy link
Owner

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

Copy link
Contributor Author

@saleha-muzammil saleha-muzammil Jul 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah,, will do this

Comment on lines 1 to 5
#include <stdio.h>
#include <stdlib.h>
Copy link
Owner

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will check this

Comment on lines 1 to 2
#include <pthread.h>
#include <assert.h>
Copy link
Owner

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.

@saleha-muzammil saleha-muzammil marked this pull request as draft August 3, 2024 16:02
@charmoniumQ
Copy link
Owner

I've pushed some work on resolving the clang-tidy warnings (mostly by restructuring #includes). Hopefully, we will be able to ignore or fix all the warnings soon, and we can then merge.

@saleha-muzammil
Copy link
Contributor Author

I've pushed some work on resolving the clang-tidy warnings (mostly by restructuring #includes). Hopefully, we will be able to ignore or fix all the warnings soon, and we can then merge.

Oh, I cloned the repo again yesterday and started all over again lol, will try to push some additional changes today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants