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

Halalaluyafail3 <luigighiron at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Arrays of character type    |Arrays of character type
                   |initialized with            |initialized with
                   |parenthesized string        |parenthesized string
                   |literals shouldn't be       |literals shouldn't be
                   |diagnosed with -pedantic    |diagnosed with -pedantic
                   |(at least in C23)           |(at least in C2Y)

--- Comment #10 from Halalaluyafail3 <luigighiron at gmail dot com> ---
(In reply to Andrew Pinski from comment #3)
> C11 still has it:
> 
> 6.7.9/14:
> An array of character type may be initialized by a character string literal
> orUTF−8 string literal, optionally enclosed in braces.
> 
> 
> 
> 
> C23 still does too:
> 
> 6.7.11/15:
> 
> Anarray of character type may be initialized by a character string literal
> or UTF-8 string literal, optionally enclosed in braces. 
> 
> 
> The wording here has not changed from C90 either.
> 
> So yes GCC is correct in the pedantic warning here.
With the latest draft N3854, the paper N3722 has been accepted so the wording
is now:

> The initializer for an array shall be: an expression that after generic
> replacement and removal of all enclosing balanced parentheses is a string
> literal; such an expression enclosed in braces; or, a brace-enclosed list
> of initializers for the elements. 
Section 6.7.11 "Initialization" Paragraph 7 N3854

Which is clearly intending to allow for parentheses and _Generic to be used.
Can this bug be reopened?

Reply via email to