Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings from GCC 7.3.0 #2665

Merged

Conversation

taketwo
Copy link
Member

@taketwo taketwo commented Nov 30, 2018

This fixes a few warnings from GCC 7.3.0 in test sources.

../test/common/test_eigen.cpp:748:12: warning: unused variable ‘c_fail_count’ [-Wunused-variable]
../test/octree/test_octree.cpp:342:10: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else]
../test/segmentation/test_random_walker.cpp:232:10: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else]

../test/common/test_eigen.cpp:748:12: warning: unused variable ‘c_fail_count’ [-Wunused-variable]
../test/octree/test_octree.cpp:342:10: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else]
../test/segmentation/test_random_walker.cpp:232:10: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else]
@SunBlack
Copy link
Contributor

Maybe you could add this to CMake to prevent new issues like this:

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR CMAKE_COMPILER_IS_GNUCXX)
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wunused-variable")
endif()

@SergioRAgostinho SergioRAgostinho merged commit 49359aa into PointCloudLibrary:master Nov 30, 2018
@taketwo taketwo deleted the fix-test-warnings branch November 30, 2018 17:19
@taketwo
Copy link
Member Author

taketwo commented Nov 30, 2018

I actually got these without setting any extra flags. We'll enable Ubuntu 18 build on CI soon and will catch these.

@SunBlack
Copy link
Contributor

Sorry, copy & paste error.

I meant: -Werror=unused-variable instead of just -Wunused-variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants