On 07.01.2026 23:18, Andrew Pinski wrote:
> On Wed, Jan 7, 2026 at 1:31 AM Maciej W. Rozycki <[email protected]> wrote:
>> --- binutils-gdb.orig/libiberty/objalloc.c
>> +++ binutils-gdb/libiberty/objalloc.c
>> @@ -178,7 +178,7 @@ objalloc_free (struct objalloc *o)
>>  {
>>    struct objalloc_chunk *l;
>>
>> -  l = (struct objalloc_chunk *) o->chunks;
>> +  l = o != NULL ? (struct objalloc_chunk *) o->chunks : NULL;
> 
> I think the following would be cleaner and easier to understand:
> ```
> /*  Handle a nullptr as being a no-op. */
> if (o == NULL)
>   return;
> l = (struct objalloc_chunk *) o->chunks;
> ```

If already we're re-working this, can't the cast be dropped as well? Or is
libiberty still required to be buildable on pre-C89?

Jan

Reply via email to