On Tue, 20 May 2025, Christopher Bazley wrote:

> +     if (!cleared)
> +       {
> +         if (complete_p.padded_non_union
> +             && warn_zero_init_padding_bits >= ZERO_INIT_PADDING_BITS_ALL)
> +           {
> +             warning (OPT_Wzero_init_padding_bits_,
> +                          "Padding bits might not be initialized to zero; "
> +                          "consider using %<-fzero-init-padding-bits=all%>");
> +           }
> +         else if (complete_p.padded_union
> +                  && warn_zero_init_padding_bits
> +                     >= ZERO_INIT_PADDING_BITS_UNIONS)
> +           {
> +             warning (OPT_Wzero_init_padding_bits_,
> +                      "Padding bits might not be initialized to zero; "
> +                      "consider using %<-fzero-init-padding-bits=unions%> "
> +                      "or %<-fzero-init-padding-bits=all%>");

Diagnostics should start with a lowercase letter.

If there's a meaningful location available for the initialization, then 
warning_at (passing an explicit location) is preferred to warning.

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

Reply via email to