Commit 125e514
authored
build: remove -Wno-unused-result from gcc options (#5214)
Background: this flag was originally added in commit c5494ac
(2015-11-24) with the message "...now builds linux+gcc...". It was later
refactored in commit 62d7164 (2017-01-23). From investigation, it
seems to be preventative rather than reactive because it does not
actively suppress warnings, but `-Werror` is enabled under the condition
NOT MSVC + STOP_ON_WARNING (originally in CMakeLists.txt, now in
compiler.cmake:126).
Compile tests without `-Wno-unused-result` but with `-Wunused-result`
explicitly enabled were conducted on the following commits, and all
compiled successfully without unused result warnings. Also, tests
confirmed that the warning triggers if there is an unused return value.
- 312793a (2026-01-01)
- 682825f (2025-01-01)
- 48362b2 (2024-01-01)
- 3b8807d (2023-01-01)
- 62d7164 (2017-01-23): refactored
- c5494ac (2015-11-24): originally added
Decision: the flag can be safely removed. Removing it allows gcc to
catch unused return values, which is required for the `OIIO_NODISCARD`
and `OIIO_NODISCARD_ERROR` macros to work as intended.
Related: #5196
Assisted-by: Claude / Opus 4.7
Signed-off-by: Luna Kim <177369799+luna-y-kim@users.noreply.github.com>1 parent df6c3ea commit 125e514
1 file changed
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
189 | 188 | | |
190 | 189 | | |
191 | 190 | | |
| |||
0 commit comments