Landing: ed9d0ebe4ecb
Project / Subsystem
gcc / gcc
Date
2026-05-15
Author
Jakub Jelinek
Commit
ed9d0ebe4ecb14e293f40e395657dd08c089ad10
Source
github
Perf win
No
Breaking
No
All attributes
- project
- gcc
- subsystem
- gcc
- patch_id
- —
- commit_hash
- ed9d0ebe4ecb14e293f40e395657dd08c089ad10
- source_type
- github
- headline
- Introduces -Wconstant-logical-operand warning.
- tldr
- GCC now warns about constant values used as operands in logical expressions (&&, ||), which are often typos.
- author
- Jakub Jelinek
- outcome
- committed
- performance_win
- false
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • warning
- • c
- • c++
- • compiler
- • diagnostics
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-05-15T00:00:00.000Z
GCC now includes a -Wconstant-logical-operand warning, enabled by -Wall, that flags constant values on either side of logical && or || operators. This catches potential errors like mistyping data->flags && ff_genericize instead of data->flags & ff_genericize. The warning is not issued if either operand is a boolean, or if the constant operand is 0 or 1.