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

clang-tidy test #30

Closed
wants to merge 2 commits into from
Closed

clang-tidy test #30

wants to merge 2 commits into from

Conversation

rex-schilasky
Copy link
Contributor

No description provided.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

@@ -184,6 +184,12 @@ namespace eCAL
// blocking call, all responses will be returned in service_response_vec_
bool CServiceClientImpl::Call(const std::string& method_name_, const std::string& request_, int timeout_ms_, ServiceResponseVecT* service_response_vec_)
{
// look that clang-tidy !
service_response_vec_->clear();
int i;

Choose a reason for hiding this comment

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

warning: variable 'i' is not initialized [cppcoreguidelines-init-variables]

Suggested change
int i;
int i = 0;

// look that clang-tidy !
service_response_vec_->clear();
int i;
char* p;

Choose a reason for hiding this comment

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

warning: variable 'p' is not initialized [cppcoreguidelines-init-variables]

Suggested change
char* p;
char* p = nullptr;

service_response_vec_->clear();
int i;
char* p;
*p = 'X';

Choose a reason for hiding this comment

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

warning: Dereference of undefined pointer value (loaded from variable 'p') [clang-analyzer-core.NullDereference]

    *p = 'X';
       ^
Additional context

ecal/core/src/service/ecal_service_client_impl.cpp:189: 'p' declared without an initial value

    char* p;
    ^

ecal/core/src/service/ecal_service_client_impl.cpp:190: Dereference of undefined pointer value (loaded from variable 'p')

    *p = 'X';
       ^

@rex-schilasky rex-schilasky deleted the test-clang-tidy branch February 19, 2024 16:53
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.

1 participant