From 710477dfccfd96efdc235c25286db2e49c21d5cf Mon Sep 17 00:00:00 2001 From: Matthijs van der Burgh Date: Fri, 23 Sep 2022 11:16:12 +0200 Subject: [PATCH 1/5] Add -Wall and -Wextra as errors --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 05cabfa..94fe9d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,9 @@ cmake_minimum_required(VERSION 2.8.3) project(virtual_cam) +add_compile_options(-Wall -Werror=all) +add_compile_options(-Wextra -Werror=extra) + find_package(catkin REQUIRED COMPONENTS cv_bridge roscpp message_generation rgbd rosbag tf) find_package(OpenCV REQUIRED) From 23db3b463cad269a49cf90e97051053f0e122ae8 Mon Sep 17 00:00:00 2001 From: Matthijs van der Burgh Date: Fri, 23 Sep 2022 11:16:40 +0200 Subject: [PATCH 2/5] Update min CMake version --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 94fe9d6..550b181 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.3) +cmake_minimum_required(VERSION 3.0.2) project(virtual_cam) add_compile_options(-Wall -Werror=all) From 5e1bc3464713e786218c342ca4c04e000ff4a0d8 Mon Sep 17 00:00:00 2001 From: Matthijs van der Burgh Date: Mon, 26 Sep 2022 12:18:06 +0200 Subject: [PATCH 3/5] Fix unused-parameter --- src/save.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/save.cpp b/src/save.cpp index 80e672e..39ca270 100644 --- a/src/save.cpp +++ b/src/save.cpp @@ -60,9 +60,9 @@ bool takeAPicturePNG(virtual_cam::cheeseRequest &req, virtual_cam::cheeseRespons void ImageCallbackCheese(const sensor_msgs::ImageConstPtr image_msg, - const sensor_msgs::CameraInfoConstPtr cam_info_msg, - const sensor_msgs::ImageConstPtr depth_image_msg, - const sensor_msgs::CameraInfoConstPtr cam_info_depth_msg) + const sensor_msgs::CameraInfoConstPtr /*cam_info_msg*/, + const sensor_msgs::ImageConstPtr /*depth_image_msg*/, + const sensor_msgs::CameraInfoConstPtr /*cam_info_depth_msg*/) { rgb_image = image_msg; } From a2d8a5c7bfe7a8ca602a39f29de828c758d49ab0 Mon Sep 17 00:00:00 2001 From: Matthijs van der Burgh Date: Mon, 26 Sep 2022 18:37:34 +0200 Subject: [PATCH 4/5] Fix unused-parameter --- src/crop.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crop.cpp b/src/crop.cpp index 628f73c..86e1477 100644 --- a/src/crop.cpp +++ b/src/crop.cpp @@ -57,7 +57,7 @@ Image Crop() // ---------------------------------------------------------------------------------------------------- -void CallBackFunc(int event, int x, int y, int flags, void* userdata) +void CallBackFunc(int event, int x, int y, int /*flags*/, void* /*userdata*/) { cv::Point2d mouse_pos(x / (double)rgb_resized.cols, y / (double)rgb_resized.cols); From 9fe3bcafc05596431e836736aafd344db8e207d9 Mon Sep 17 00:00:00 2001 From: Matthijs van der Burgh Date: Mon, 26 Sep 2022 18:52:03 +0200 Subject: [PATCH 5/5] (CMake) mark catkin and opencv as system includes --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 550b181..4541440 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ catkin_package( ## Build ## ########### -include_directories(include ${catkin_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS}) +include_directories(include SYSTEM ${catkin_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS}) # Declare a cpp library add_library(virtual_cam_image_loader