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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/clang-tidy-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ jobs:
-DECAL_CORE_PUBLISHER=ON \
-DECAL_CORE_SUBSCRIBER=ON \
-DECAL_CORE_SERVICE=ON \
-DECAL_CORE_TIMEPLUGIONN=ON \
-DECAL_CORE_TRANSPORT_UDPON=ON \
-DECAL_CORE_TRANSPORT_TCPON=ON \
-DECAL_CORE_TRANSPORT_SHMON=ON \
-DECAL_CORE_TIMEPLUGIN=ON \
-DECAL_CORE_TRANSPORT_UDP=ON \
-DECAL_CORE_TRANSPORT_TCP=ON \
-DECAL_CORE_TRANSPORT_SHM=ON \
-DECAL_CORE_NPCAP_SUPPORT=OFF \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_SYSCONFDIR=/etc \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LOCALSTATEDONIR=/var \
-DCMAKE_INSTALL_LOCALSTATEDIR=/var \
-DCMAKE_INSTALL_LIBDIR=lib/x86_FF4-linux-gnu
cmake --build _build

Expand Down
6 changes: 6 additions & 0 deletions ecal/core/src/service/ecal_service_client_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

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;

*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';
       ^


if(service_response_vec_ == nullptr) return false;
service_response_vec_->clear();

Expand Down
Loading