Skip to content

Commit 1b77dd5

Browse files
committed
fix: new clang-tidy errors
1 parent 25e753d commit 1b77dd5

9 files changed

Lines changed: 21 additions & 22 deletions

File tree

.clang-tidy

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
---
2-
Checks: >
3-
clang-analyzer-*,
4-
-clang-analyzer-optin.cplusplus.VirtualCall,
5-
clang-diagnostic-*,
6-
google-*,
7-
misc-*,
8-
-misc-non-private-member-variables-in-classes,
9-
readability-*,
10-
-readability-identifier-length,
11-
-readability-magic-numbers,
2+
Checks: [
3+
clang-analyzer-*,
4+
-clang-analyzer-optin.cplusplus.VirtualCall,
5+
clang-diagnostic-*,
6+
google-*,
7+
misc-*,
8+
-misc-non-private-member-variables-in-classes,
9+
readability-*,
10+
-readability-container-contains, # Removed for compatiblity with C++17 which is used in ROS Humble
11+
-readability-identifier-length,
12+
-readability-magic-numbers,
13+
]
1214

1315
CheckOptions:
1416
misc-include-cleaner.IgnoreHeaders: bits/chrono.h
@@ -23,13 +25,13 @@ CheckOptions:
2325
readability-identifier-naming.StaticConstantCase: lower_case
2426
readability-identifier-naming.StaticVariableCase: lower_case
2527
readability-identifier-naming.MacroDefinitionCase: UPPER_CASE
26-
readability-identifier-naming.MacroDefinitionIgnoredRegexp: '^[A-Z]+(_[A-Z]+)*_$'
28+
readability-identifier-naming.MacroDefinitionIgnoredRegexp: "^[A-Z]+(_[A-Z]+)*_$"
2729
readability-identifier-naming.PrivateMemberCase: lower_case
2830
readability-identifier-naming.ProtectedMemberCase: lower_case
2931
readability-identifier-naming.PublicMemberCase: lower_case
3032
readability-identifier-naming.PrivateMemberSuffix: _
3133
readability-identifier-naming.ProtectedMemberSuffix: _
32-
readability-identifier-naming.PublicMemberSuffix: ''
34+
readability-identifier-naming.PublicMemberSuffix: ""
3335
readability-identifier-naming.NamespaceCase: lower_case
3436
readability-identifier-naming.ParameterCase: lower_case
3537
readability-identifier-naming.TypeAliasCase: CamelCase

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ jobs:
2121
ROS_DISTRO: ${{ matrix.ROS_DISTRO }}
2222
ROS_REPO: ${{ matrix.ROS_REPO }}
2323
CMAKE_ARGS: ${{ matrix.ROS_DISTRO == 'rolling' && '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DENABLE_CLANG_TIDY=ON' || '' }}
24+
# gcc-16 is installed on the rolling image alongside gcc-15 but without its
25+
# libstdc++ headers, so clang-tidy (which auto-selects the newest GCC found)
26+
# fails with "'chrono'/'string'/'memory' file not found". Installing
27+
# libstdc++-16-dev fixes this.
28+
ADDITIONAL_DEBS: ${{ matrix.ROS_DISTRO == 'rolling' && 'libstdc++-16-dev' || '' }}
2429
steps:
2530
- name: Checkout repo
2631
uses: actions/checkout@v4

CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.10)
22
project(web_video_server)
33

44
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
@@ -25,10 +25,6 @@ pkg_check_modules(avformat libavformat REQUIRED)
2525
pkg_check_modules(avutil libavutil REQUIRED)
2626
pkg_check_modules(swscale libswscale REQUIRED)
2727

28-
if(NOT CMAKE_CXX_STANDARD)
29-
set(CMAKE_CXX_STANDARD 14)
30-
endif()
31-
3228
###################################################
3329
## Declare things to be passed to other projects ##
3430
###################################################

src/streamers/image_transport_streamer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
#include "image_transport/image_transport.hpp"
5555
#include "rclcpp/node.hpp"
5656
#include "rclcpp/logging.hpp"
57+
#include "rclcpp/qos.hpp"
5758
#include "rmw/qos_profiles.h"
5859
#include "sensor_msgs/msg/image.hpp"
5960

src/streamers/jpeg_streamers.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#include <chrono>
3434
#include <cstdint>
3535
#include <cstdio>
36-
#include <cstring>
3736
#include <memory>
3837
#include <mutex>
3938
#include <string>

src/streamers/png_streamers.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include <chrono>
3333
#include <cstdint>
3434
#include <cstdio>
35-
#include <cstring>
3635
#include <memory>
3736
#include <mutex>
3837
#include <string>

src/streamers/vp8_streamer.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ extern "C"
3636
#include <libavutil/opt.h>
3737
}
3838

39-
#include <cstring>
4039
#include <map>
4140
#include <memory>
4241

src/streamers/vp9_streamer.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ extern "C"
3535
#include <libavutil/opt.h>
3636
}
3737

38-
#include <cstring>
3938
#include <memory>
4039

4140
#include "async_web_server_cpp/http_connection.hpp"

src/web_video_server.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333
#include <algorithm>
3434
#include <chrono>
35-
#include <cstring>
3635
#include <exception>
3736
#include <map>
3837
#include <memory>

0 commit comments

Comments
 (0)