Skip to content

Commit 76560ee

Browse files
author
Gin
committed
fix warning on clang
1 parent 3cfbbe9 commit 76560ee

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

SerialPrograms/CMakeLists.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2609,11 +2609,14 @@ else() # macOS and Linux
26092609
endif()
26102610

26112611
if (APPLE)
2612-
# Add -Wno-c11-extensions to avoid clang gives
2612+
###################################################
2613+
# Compiler flag change history:
2614+
# Removed -Wno-c11-extensions since we no long have following error:
26132615
# /usr/local/Cellar/opencv/4.5.5_3/include/opencv4/opencv2/core/mat.inl.hpp:2116:9: error: '_Atomic' is a C11 extension
26142616
# when compiling OpenCV
2615-
# target_compile_options(SerialPrograms PRIVATE -Wall -Wextra -Wpedantic -Werror -Wno-c11-extensions)
2616-
target_compile_options(SerialPrograms PRIVATE -Wall -Wextra -Wpedantic -Werror -Wshorten-64-to-32)
2617+
###################################################
2618+
# Use https://clang.llvm.org/docs/DiagnosticsReference.html to query Clang warnings
2619+
target_compile_options(SerialPrograms PRIVATE -Wall -Wextra -Wpedantic -Werror -Wshorten-64-to-32 -Wtautological-constant-in-range-compare -Wsequence-point)
26172620
else()
26182621
# Assume GCC
26192622
target_compile_options(SerialPrograms PRIVATE -Wall -Wextra -Wpedantic -Werror -fno-strict-aliasing)

SerialPrograms/Source/ML/Programs/ML_LabelImages.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ void LabelImages::update_rendered_objects(){
263263
}
264264
create_overlay_for_index(i_obj);
265265
}
266-
if (m_selected_obj_idx >= 0 && m_selected_obj_idx < m_annotations.size()){
266+
if (m_selected_obj_idx < m_annotations.size()){
267267
create_overlay_for_index(m_selected_obj_idx);
268268
}
269269
}

0 commit comments

Comments
 (0)