On Sat, 7 Jun 2025, Martin Uecker wrote:

> Add a helper function to replace repeated code for removing
> qualifiers but not atomic.  Make sure to also remove qualifiers
> but not atomic on the element type of arrays.
> 
>       PR c/120510
> 
> gcc/c/ChangeLog:
>       * c-typeck.c (remove_qualifiers): New function.
>       (composite_type_internal): Use it.
>       (comp_target_types): Use it.
>       (type_lists_compatible_p): Use it.
>       (find_anonymous_field_with_type): Use it.
>       (convert_to_anonymous_field): Use it.
>       (convert_for_assignment): Use it.

OK.

I think the changes regarding arrays in type_lists_compatible_p are OK 
because array parameters aren't possible, and in convert_for_assignment 
are OK because there's other code to handle pre-C23 compatibility rules, 
but in general it can't be assumed that removing qualifiers on arrays will 
be correct in all contexts; it needs to be considered case by case what 
removal of qualifiers should do with array types.

-- 
Joseph S. Myers
josmy...@redhat.com

Reply via email to