AcademySoftwareFoundation / AcademySoftwareFoundation/OpenTimelineIO
Clang warning suppression flag applied to gcc builds
- Dominant language
- C++
- Stars
- 2k
- Forks
- 351
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 1
Description
When building with gcc 14.2 I get the following warnings:
```
cc1plus: note: unrecognized command-line option '-Wno-range-loop-analysis' may have been intended to silence earlier diagnostics
cc1plus: note: unrecognized command-line option '-Wno-range-loop-analysis' may have been intended to silence earlier diagnostics
cc1plus: note: unrecognized command-line option '-Wno-range-loop-analysis' may have been intended to silence earlier diagnostics
cc1plus: note: unrecognized command-line option '-Wno-range-loop-analysis' may have been intended to silence earlier diagnostics
cc1plus: note: unrecognized command-line option '-Wno-range-loop-analysis' may have been intended to silence earlier diagnostics
cc1plus: note: unrecognized command-line option '-Wno-range-loop-analysis' may have been intended to silence earlier diagnostics
```
I believe these come from the following CMake macros in
- `src/py-opentimelineio/opentime-bindings/CMakeLists.txt`
- `src/py-opentimeline/opentimelineio-bindings/CMakeLists.txt`
```
# The version of pybind11 we are currently using generates an overwhelming number of
# compiler warnings; until we update pybind11, suprress the warnings:
target_compile_options(_opentime PRIVATE
$<$,$,$>:
-Wno-range-loop-analysis>
$<$,$,$>:
-Wno-unused-value>
$<$: /EHsc>
)
```
This incorrectly adds `-Wno-range-loop-analysis` to gcc, but that's not a valid gcc flag. The equivalent flag for gcc is `-Wno-range-loop-construct`
I believe the following update should set the correct flags for both clang and gcc:
```
target_compile_options(_opentime PRIVATE
$<$,$>:
-Wno-range-loop-analysis>
$<$:
-Wno-range-loop-construct>
$<$,$,$>:
-Wno-unused-value>
$<$: /EHsc>
)
```
Contributor guide
Research direction
Compare the target_compile_options blocks in src/py-opentimelineio/opentime-bindings/CMakeLists.txt and src/py-opentimeline/opentimelineio-bindings/CMakeLists.txt. Build with GCC 14.2 to verify that -Wno-range-loop-analysis is no longer passed to GCC and that the appropriate compiler-specific flags are used for Clang and GCC.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 86/100