Re: [PATCH 1/1] z80: avoid error with newer compilers due to lost "const"
H. Peter Anvin
hpa@zytor.com
Mon Sep 7 20:40:45 GMT 2026
On September 6, 2026 11:25:24 PM PDT, Jan Beulich <jbeulich@suse.com> wrote:
>On 06.09.2026 23:55, H. Peter Anvin wrote:
>> With newer gcc+glibc (16.2.1, 2.43) bsearch() and many other functions
>> propagate "const"-ness. This causes a build error in tc-z80.c.
>>
>> The pointer that is missing "const" is ever written to, so simply fix
>> it by adding the missing "const".
>>
>> This bug has existed since the Z80 target was introduced.
>>
>> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
>
>Likely counts as obvious. I'll get this in for you in due course.
>
>Jan
>
>> --- a/gas/config/tc-z80.c
>> +++ b/gas/config/tc-z80.c
>> @@ -1086,7 +1086,7 @@ parse_cc (const char *s, char * op)
>> {
>> const char *p;
>> int i;
>> - struct reg_entry * cc_p;
>> + const struct reg_entry * cc_p;
>>
>> for (i = 0; i < BUFLEN; ++i)
>> {
>
One minor correction, though:
s/ever written to/never written through/
:)
More information about the Binutils
mailing list