Skip to content

Commit

Permalink
[#555] Rename TREAT_WARNING_AS_ERROR into WARNING_AS_ERROR; fix clang…
Browse files Browse the repository at this point in the history
… warnings
  • Loading branch information
elfenpiff committed Dec 20, 2024
1 parent 3d79678 commit b79b0e3
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ jobs:
- name: Build language bindings
# NOTE: the cmake command is in a single line since Windows complains about breaking up lines with '\'
run: |
cmake -S . -B target/ffi/build -DBUILD_EXAMPLES=ON -DBUILD_TESTING=ON -DTREAT_WARNING_AS_ERROR=ON ${{ matrix.mode.cmake-build-type }} ${{ matrix.mode.cmake-cxx-flags }} ${{ matrix.cmake-build-system-generator }} -DCMAKE_INSTALL_PREFIX=target/ffi/install -DCMAKE_PREFIX_PATH="${{ github.workspace }}/target/iceoryx/install" -DRUST_BUILD_ARTIFACT_PATH="${{ github.workspace }}/target/${{ matrix.mode.name }}"
cmake -S . -B target/ffi/build -DBUILD_EXAMPLES=ON -DBUILD_TESTING=ON -DWARNING_AS_ERROR=ON ${{ matrix.mode.cmake-build-type }} ${{ matrix.mode.cmake-cxx-flags }} ${{ matrix.cmake-build-system-generator }} -DCMAKE_INSTALL_PREFIX=target/ffi/install -DCMAKE_PREFIX_PATH="${{ github.workspace }}/target/iceoryx/install" -DRUST_BUILD_ARTIFACT_PATH="${{ github.workspace }}/target/${{ matrix.mode.name }}"
cmake --build target/ffi/build ${{ matrix.mode.cmake-build-config }}
cmake --install target/ffi/build ${{ matrix.mode.cmake-build-config }}
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ add_option(
)

add_option(
NAME TREAT_WARNING_AS_ERROR
NAME WARNING_AS_ERROR
DESCRIPTION "Fails if the compiler emits a warning"
DEFAULT_VALUE OFF
)
Expand Down Expand Up @@ -116,7 +116,7 @@ add_rust_feature(
RUST_FEATURE "iceoryx2/logger_tracing"
)

if(TREAT_WARNING_AS_ERROR)
if(WARNING_AS_ERROR)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Wall -Wextra -Wpedantic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -Wpedantic")
endif()
Expand Down
3 changes: 0 additions & 3 deletions examples/cxx/event_multiplexing/src/wait.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
#include "iox2/service_type.hpp"
#include "iox2/waitset.hpp"

constexpr iox::units::Duration CYCLE_TIME = iox::units::Duration::fromSeconds(1);

// NOLINTBEGIN
struct Args {
IOX_CLI_DEFINITION(Args);
Expand All @@ -42,7 +40,6 @@ auto main(int argc, char** argv) -> int {
using namespace iox2;
auto args = Args::parse(argc, argv, "Notifier of the event multiplexing example.");

auto event_id = EventId(args.event_id());
auto service_name_1 = ServiceName::create(args.service1().c_str()).expect("valid service name");
auto service_name_2 = ServiceName::create(args.service2().c_str()).expect("valid service name");

Expand Down
2 changes: 1 addition & 1 deletion iceoryx2-ffi/cxx/src/node_name.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ auto NodeName::create_impl(const char* value, size_t value_len) -> iox::expected
iox2_node_name_h handle {};
const auto ret_val = iox2_node_name_new(nullptr, value, value_len, &handle);
if (ret_val == IOX2_OK) {
return iox::ok(std::move(NodeName { handle }));
return iox::ok(NodeName { handle });
}

return iox::err(iox::into<SemanticStringError>(ret_val));
Expand Down
2 changes: 1 addition & 1 deletion iceoryx2-ffi/cxx/tests/src/node_state_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class NodeStateTest : public ::testing::Test {
static constexpr ServiceType TYPE = T::TYPE;
};

TYPED_TEST_SUITE(NodeStateTest, iox2_testing::ServiceTypes);
TYPED_TEST_SUITE(NodeStateTest, iox2_testing::ServiceTypes, );

TYPED_TEST(NodeStateTest, alive_node_works) {
constexpr ServiceType SERVICE_TYPE = TestFixture::TYPE;
Expand Down
2 changes: 1 addition & 1 deletion iceoryx2-ffi/cxx/tests/src/node_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class NodeTest : public ::testing::Test {
static constexpr ServiceType TYPE = T::TYPE;
};

TYPED_TEST_SUITE(NodeTest, iox2_testing::ServiceTypes);
TYPED_TEST_SUITE(NodeTest, iox2_testing::ServiceTypes, );

TYPED_TEST(NodeTest, node_name_is_applied) {
constexpr ServiceType SERVICE_TYPE = TestFixture::TYPE;
Expand Down
2 changes: 1 addition & 1 deletion iceoryx2-ffi/cxx/tests/src/service_event_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct ServiceEventTest : public ::testing::Test {
template <typename T>
std::atomic<size_t> ServiceEventTest<T>::event_id_counter { 0 };

TYPED_TEST_SUITE(ServiceEventTest, iox2_testing::ServiceTypes);
TYPED_TEST_SUITE(ServiceEventTest, iox2_testing::ServiceTypes, );

TYPED_TEST(ServiceEventTest, created_service_does_exist) {
constexpr ServiceType SERVICE_TYPE = TestFixture::TYPE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ServicePublishSubscribeTest : public ::testing::Test {
static constexpr ServiceType TYPE = T::TYPE;
};

TYPED_TEST_SUITE(ServicePublishSubscribeTest, iox2_testing::ServiceTypes);
TYPED_TEST_SUITE(ServicePublishSubscribeTest, iox2_testing::ServiceTypes, );

TYPED_TEST(ServicePublishSubscribeTest, created_service_does_exist) {
constexpr ServiceType SERVICE_TYPE = TestFixture::TYPE;
Expand Down
2 changes: 1 addition & 1 deletion iceoryx2-ffi/cxx/tests/src/unique_port_id_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ struct UniquePortIdTest : public ::testing::Test {
// NOLINTEND(misc-non-private-member-variables-in-classes)
};

TYPED_TEST_SUITE(UniquePortIdTest, iox2_testing::ServiceTypes);
TYPED_TEST_SUITE(UniquePortIdTest, iox2_testing::ServiceTypes, );

TYPED_TEST(UniquePortIdTest, unique_port_id_value) {
auto null_id = iox::vector<uint8_t, iox2::UNIQUE_PORT_ID_LENGTH> { iox2::UNIQUE_PORT_ID_LENGTH, 0 };
Expand Down
2 changes: 1 addition & 1 deletion iceoryx2-ffi/cxx/tests/src/waitset_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct WaitSetTest : public ::testing::Test {
// NOLINTEND(misc-non-private-member-variables-in-classes)
};

TYPED_TEST_SUITE(WaitSetTest, iox2_testing::ServiceTypes);
TYPED_TEST_SUITE(WaitSetTest, iox2_testing::ServiceTypes, );

TYPED_TEST(WaitSetTest, newly_created_waitset_is_empty) {
auto sut = this->create_sut();
Expand Down

0 comments on commit b79b0e3

Please sign in to comment.