[PATCH 1/1] z80: avoid error with newer compilers due to lost "const"
Project / Subsystem
binutils / z80
Date
2026-09-06
Proposer
"H. Peter Anvin" <hpa@zytor.com>
Source type
public_inbox
Consensus
Proposed
Sentiment
9/10
Technical tradeoffs
- • Strict const correctness vs. historical laxity.
- • Minimal code change for build compatibility.
All attributes
- project
- binutils
- subsystem
- z80
- patch_id
- —
- discussion_id
- 20260906215526.958487-1-hpa@zytor.com
- source_type
- public_inbox
- title
- [PATCH 1/1] z80: avoid error with newer compilers due to lost "const"
- headline
- z80: avoid error with newer compilers due to lost "const"
- tldr
- H. Peter Anvin adds missing 'const' to a pointer in tc-z80.c to fix a build error with newer GCC/glibc versions.
- proposer
- "H. Peter Anvin" <hpa@zytor.com>
- consensus
- Proposed
- outcome
- proposed
- sentiment_score
- 9
- technical_tradeoffs
-
- • Strict const correctness vs. historical laxity.
- • Minimal code change for build compatibility.
- series_id
- binutils:z80: avoid error with newer compilers due to lost "const"
- series_role
- reply
- series_parts
- []
- tags
-
- • z80
- • build
- • const
- • compiler
- • glibc
- bugzilla_url
- —
- date
- 2026-09-06T00:00:00.000Z
[PATCH 1/1] z80: avoid error with newer compilers due to lost "const"
H. Peter Anvin proposes a fix for a build error in tc-z80.c that occurs with newer GCC and glibc versions (16.2.1, 2.43). The error arises because functions like bsearch() now propagate ‘const’-ness, and a pointer in tc-z80.c was missing this qualifier. Since the pointer is never written to, adding ‘const’ resolves the issue without side effects. This bug has been present since the Z80 target was introduced.