Skip to content

Commit

Permalink
Disable warning: assuming signed overflow does not occur when reducin…
Browse files Browse the repository at this point in the history
…g constant in comparison [-Wstrict-overflow]
  • Loading branch information
fspindle committed Oct 10, 2018
1 parent 9676772 commit d8e51d3
Show file tree
Hide file tree
Showing 15 changed files with 61 additions and 6 deletions.
4 changes: 3 additions & 1 deletion example/direct-visual-servoing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
# Description:
# ViSP configuration file.
# ViSP configuration file.
#
# Authors:
# Fabien Spindler
Expand All @@ -53,4 +53,6 @@ foreach(cpp ${example_cpp})
endif()
endforeach()

vp_set_source_file_compile_flag(photometricVisualServoing.cpp -Wno-strict-overflow)

add_test(photometricVisualServoing photometricVisualServoing -c -n 20 ${OPTION_TO_DESACTIVE_DISPLAY})
3 changes: 2 additions & 1 deletion example/video/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
# Description:
# ViSP overall configuration file.
# ViSP overall configuration file.
#
# Authors:
# Fabien Spindler
Expand Down Expand Up @@ -58,3 +58,4 @@ foreach(cpp ${example_cpp})
add_test(${target} ${target} -c ${OPTION_TO_DESACTIVE_DISPLAY})
endforeach()

vp_set_source_file_compile_flag(imageSequenceReader.cpp -Wno-strict-overflow)
10 changes: 10 additions & 0 deletions modules/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,16 @@ if(USE_EIGEN3)
vp_set_source_file_compile_flag(src/math/matrix/vpMatrix_svd.cpp -Wno-float-equal -Wno-strict-overflow -Wno-misleading-indentation -Wno-int-in-bool-context)
vp_set_source_file_compile_flag(src/math/matrix/vpMatrix_lu.cpp -Wno-float-equal -Wno-strict-overflow -Wno-misleading-indentation -Wno-int-in-bool-context)
endif()
vp_set_source_file_compile_flag(src/image/vpImageConvert.cpp -Wno-strict-overflow)
vp_set_source_file_compile_flag(src/image/vpImageFilter.cpp -Wno-strict-overflow)
vp_set_source_file_compile_flag(src/image/vpImageTools.cpp -Wno-strict-overflow)
vp_set_source_file_compile_flag(src/tools/network/vpServer.cpp -Wno-strict-overflow)
vp_set_source_file_compile_flag(src/tools/optimization/vpQuadProg.cpp -Wno-strict-overflow)
vp_set_source_file_compile_flag(src/tools/optimization/vpLinProg.cpp -Wno-strict-overflow)
vp_set_source_file_compile_flag(src/tools/histogram/vpHistogram.cpp -Wno-strict-overflow)
vp_set_source_file_compile_flag(test/image/testImageBinarise.cpp -Wno-strict-overflow)
vp_set_source_file_compile_flag(test/network/testClient.cpp -Wno-strict-overflow)
vp_set_source_file_compile_flag(test/network/testServer.cpp -Wno-strict-overflow)

vp_add_module(core PRIVATE_OPTIONAL ${LAPACK_LIBRARIES} WRAP java)

Expand Down
3 changes: 3 additions & 0 deletions modules/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,6 @@ vp_glob_module_sources()
vp_module_include_directories(${opt_incs})
vp_create_module(${opt_libs})
vp_add_tests(DEPENDS_ON visp_io)

vp_set_source_file_compile_flag(src/display/vpDisplayX.cpp -Wno-strict-overflow)
vp_set_source_file_compile_flag(src/display/vpDisplayOpenCV.cpp -Wno-strict-overflow)
3 changes: 3 additions & 0 deletions modules/imgproc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,6 @@ vp_create_module()
vp_add_tests(DEPENDS_ON visp_imgproc visp_io)

vp_set_source_file_compile_flag(src/vpCLAHE.cpp -Wno-strict-overflow)
vp_set_source_file_compile_flag(src/vpThreshold.cpp -Wno-strict-overflow)
vp_set_source_file_compile_flag(src/vpFloodFill.cpp -Wno-strict-overflow)
vp_set_source_file_compile_flag(test/testContours.cpp -Wno-strict-overflow)
3 changes: 3 additions & 0 deletions modules/io/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,6 @@ vp_glob_module_sources()
vp_module_include_directories(${opt_incs})
vp_create_module(${opt_libs})
vp_add_tests(DEPENDS_ON visp_features)

vp_set_source_file_compile_flag(src/tools/vpParseArgv.cpp -Wno-strict-overflow)

17 changes: 13 additions & 4 deletions modules/robot/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,17 @@ if(USE_VIRTUOSE)
# Disable Visual C++ C4312 warning occuring on 3rd party VirtuoseAPI.h file
# VirtuoseAPI.h(280): warning C4312: 'type cast': conversion from 'int' to 'char *' of greater size
# VirtuoseAPI.h(302): warning C4312: 'type cast': conversion from 'int' to 'VirtContext' of greater size
if(BUILD_SHARED_LIBS)
if(BUILD_SHARED_LIBS)
vp_set_source_file_compile_flag(src/haptic-device/virtuose/vpVirtuose.cpp /wd4312)
vp_set_source_file_compile_flag(test/virtuose/testVirtuose.cpp /wd4312)
vp_set_source_file_compile_flag(test/virtuose/testVirtuoseAfma6.cpp /wd4312)
vp_set_source_file_compile_flag(test/virtuose/testVirtuoseHapticBox.cpp /wd4312)
vp_set_source_file_compile_flag(test/virtuose/testVirtuoseJointLimits.cpp /wd4312)
vp_set_source_file_compile_flag(test/virtuose/testVirtuosePeriodicFunction.cpp /wd4312)
vp_set_source_file_compile_flag(test/virtuose/testVirtuoseWithGlove.cpp /wd4312)
else()
vp_warnings_disable(CMAKE_CXX_FLAGS /wd4312)
endif()
else()
vp_warnings_disable(CMAKE_CXX_FLAGS /wd4312)
endif()
endif()
endif()

Expand Down Expand Up @@ -176,6 +176,15 @@ if(USE_COIN3D)
endif()
endif()

vp_set_source_file_compile_flag(src/light/vpRingLight.cpp -Wno-strict-overflow)
vp_set_source_file_compile_flag(src/wireframe-simulator/vpWireFrameSimulator.cpp -Wno-strict-overflow)
vp_set_source_file_compile_flag(src/wireframe-simulator/vpClipping.cpp -Wno-strict-overflow)
vp_set_source_file_compile_flag(src/wireframe-simulator/vpBoundio.cpp -Wno-strict-overflow)
vp_set_source_file_compile_flag(src/wireframe-simulator/vpCoreDisplay.cpp -Wno-strict-overflow)
vp_set_source_file_compile_flag(src/wireframe-simulator/vpLex.cpp -Wno-strict-overflow)
vp_set_source_file_compile_flag(src/wireframe-simulator/vpBound.cpp -Wno-strict-overflow)
vp_set_source_file_compile_flag(src/wireframe-simulator/vpArit.cpp -Wno-strict-overflow)

# copy robot and wireframe simulator data
vp_glob_module_copy_data("src/robot-simulator/arms/*.bnd" data/robot-simulator)
vp_glob_module_copy_data("src/wireframe-simulator/scene/*.bnd" data/wireframe-simulator)
Expand Down
2 changes: 2 additions & 0 deletions modules/tracker/blob/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@ vp_glob_module_sources()
vp_module_include_directories()
vp_create_module()
vp_add_tests(DEPENDS_ON visp_visual_features visp_gui visp_io)

vp_set_source_file_compile_flag(src/dots/vpDot2.cpp -Wno-strict-overflow)
2 changes: 2 additions & 0 deletions modules/tracker/klt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@ vp_glob_module_sources()
vp_module_include_directories()
vp_create_module()
vp_add_tests()

vp_set_source_file_compile_flag(src/vpKltOpencv.cpp -Wno-strict-overflow)
3 changes: 3 additions & 0 deletions modules/tracker/mbt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@ if(MSVC)
endif()
endif()

vp_set_source_file_compile_flag(src/vpMbTracker.cpp -Wno-strict-overflow)
vp_set_source_file_compile_flag(src/klt/vpMbKltTracker.cpp -Wno-strict-overflow)

vp_module_include_directories(${opt_incs})
vp_create_module(${opt_libs})

Expand Down
3 changes: 3 additions & 0 deletions modules/tracker/me/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ vp_glob_module_sources()
vp_module_include_directories()
vp_create_module()
vp_add_tests(DEPENDS_ON visp_io visp_gui)

vp_set_source_file_compile_flag(src/moving-edges/vpMeSite.cpp -Wno-strict-overflow)

4 changes: 4 additions & 0 deletions modules/tracker/tt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@ vp_add_module(tt visp_vision visp_core)
vp_glob_module_sources()
vp_module_include_directories()
vp_create_module()

vp_set_source_file_compile_flag(src/vpTemplateTracker.cpp -Wno-strict-overflow)
vp_set_source_file_compile_flag(src/warp/vpTemplateTrackerWarp.cpp -Wno-strict-overflow)
vp_set_source_file_compile_flag(src/warp/vpTemplateTrackerWarpHomographySL3.cpp -Wno-strict-overflow)
3 changes: 3 additions & 0 deletions modules/tracker/tt_mi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@

vp_define_module(tt_mi visp_tt)

vp_set_source_file_compile_flag(src/mi/vpTemplateTrackerMIInverseCompositional.cpp -Wno-strict-overflow)
vp_set_source_file_compile_flag(src/tools/vpTemplateTrackerMIBSpline.cpp -Wno-strict-overflow)

# The previous line is similar to the following:
#vp_add_module(tt_mi visp_tt)
#vp_glob_module_sources()
Expand Down
5 changes: 5 additions & 0 deletions modules/vision/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,9 @@ else()
endif()
endif()

vp_set_source_file_compile_flag(src/pose-estimation/vpPoseFeatures.cpp -Wno-strict-overflow)
vp_set_source_file_compile_flag(src/pose-estimation/vpPoseRansac.cpp -Wno-strict-overflow)
vp_set_source_file_compile_flag(src/pose-estimation/vpLevenbergMarquartd.cpp -Wno-strict-overflow)
vp_set_source_file_compile_flag(src/key-point/vpKeyPoint.cpp -Wno-strict-overflow)

add_test(testKeyPoint-2-multithreaded testKeyPoint-2 -c ${OPTION_TO_DESACTIVE_DISPLAY} -p)
2 changes: 2 additions & 0 deletions tutorial/imgproc/flood-fill/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ foreach(cpp ${tutorial_cpp})
visp_add_dependency(${cpp} "tutorials")
endif()
endforeach()

vp_set_source_file_compile_flag(tutorial-flood-fill.cpp -Wno-strict-overflow)

0 comments on commit d8e51d3

Please sign in to comment.