https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115185

--- Comment #20 from Wentao Zhang <wentaoz5 at illinois dot edu> ---
(In reply to Wentao Zhang from comment #18)
> 
> will get expanded to 
> 
>       [POWER_SUPPLY_PROP_CHARGE_CONTROL_START_THRESHOLD] = {
>               .prop_name = "CHARGE_CONTROL_START_THRESHOLD",
>               .attr_name = "j" "\0",
>               .text_values = ((void *)0),
>               .text_values_len = 0,
>       },
> 
> It still triggers the warning even if "\0" is explicitly specified and the
> length is exactly MAX_PROP_NAME_LEN + 1 (31).

Sorry I mistyped. It should be

        [POWER_SUPPLY_PROP_CHARGE_CONTROL_START_THRESHOLD] = {
                .prop_name = "CHARGE_CONTROL_START_THRESHOLD",
                .attr_name = "CHARGE_CONTROL_START_THRESHOLD" "\0",
                .text_values = ((void *)0),
                .text_values_len = 0,
        },

Thanks, Andrew!

Reply via email to