PointCloudLibrary / PointCloudLibrary/pcl
Reduce warnings during compilation with all (usual) warnings switched on
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 11.1k
- Forks
- 4.7k
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 6
Description
To increase code quality of new PR, we should treat warnings as errors (as already mentioned here #2733).
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror")
In case we have not solved all compiler warnings, before introducing this change, we have to whitelist this warning types (global or per target).
Because with new compilers sometimes new compiler warnings will be introduced, we should care about this:
- Option 1: Instead of
-Werrorexplicitly list all warning types which should treat as error (this list could be really long), so new warnings will be not treated as error - Option 2: Add an option to enable/disable this change.
if(CMAKE_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GCC)
option(PCL_Treat_warnings_as_errors TRUE) # TRUE or FALSE as default?
if(PCL_Treat_warnings_as_errors )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror")
endif()
endif()
Before we can introduce this, we need to resolve #2732 & #2745, so 3rd-party code cannot raise warnings.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the repository's CMake configuration and issues #2732 and #2745, which must be resolved first so third-party code does not emit warnings. Determine whether the project should use an explicit warning list or an option-controlled -Werror path, then verify compilation with the usual warnings enabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100