public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/95379] New: Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute.
@ 2020-05-27 23:00 AsDaGo at posteo dot net
  2020-05-28  2:14 ` [Bug c/95379] " pinskia at gcc dot gnu.org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: AsDaGo at posteo dot net @ 2020-05-27 23:00 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95379
           Summary: Don't warn about the universal zero initializer for a
                    structure with the 'designated_init' attribute.
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: AsDaGo at posteo dot net
  Target Milestone: ---

Created attachment 48623
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48623&action=edit
A small program illustrating the bug

When the 'designated_init' attribute is used on a structure type, GCC warns
when an instance of that structure is initialized with '{ 0 }'. I think GCC
should make an exception for this, since '{ 0 }' is often used to initialize
all fields of a structure to 0, and it does not depend on the internal
structure of the structure type.

If '{ }' is used to initialize the structure, GCC does not warn. However,
although '{ }' seems to initialize the structure to zero in GCC, I'm not sure
if it's as portable as '{ 0 }' (and it's less readable, IMO). I think '{ }' is
part of the C++ standard; does anyone know if it's part of C too?

See the attached test program (compile with 'gcc -o test test.c').

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug c/95379] Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute.
  2020-05-27 23:00 [Bug c/95379] New: Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute AsDaGo at posteo dot net
@ 2020-05-28  2:14 ` pinskia at gcc dot gnu.org
  2020-05-28  2:16 ` pinskia at gcc dot gnu.org
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: pinskia at gcc dot gnu.org @ 2020-05-28  2:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Why not just use { .foo = 0 }; instead?

Also this attribute is model after sparse's attribute, does sparse implement
what you are asking (https://sparse.wiki.kernel.org/index.php/Main_Page)?

Reference:
https://gcc.gnu.org/legacy-ml/gcc-patches/2014-01/msg01284.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug c/95379] Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute.
  2020-05-27 23:00 [Bug c/95379] New: Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute AsDaGo at posteo dot net
  2020-05-28  2:14 ` [Bug c/95379] " pinskia at gcc dot gnu.org
@ 2020-05-28  2:16 ` pinskia at gcc dot gnu.org
  2020-05-28  3:28 ` AsDaGo at posteo dot net
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: pinskia at gcc dot gnu.org @ 2020-05-28  2:16 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=59855

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Also see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59855 for some history on
this attribute.
I suspect this will be closed as won't fix.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug c/95379] Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute.
  2020-05-27 23:00 [Bug c/95379] New: Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute AsDaGo at posteo dot net
  2020-05-28  2:14 ` [Bug c/95379] " pinskia at gcc dot gnu.org
  2020-05-28  2:16 ` pinskia at gcc dot gnu.org
@ 2020-05-28  3:28 ` AsDaGo at posteo dot net
  2020-05-28  7:41 ` rguenth at gcc dot gnu.org
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: AsDaGo at posteo dot net @ 2020-05-28  3:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Asher Gordon <AsDaGo at posteo dot net> ---
Thanks for the quick reply!

(In reply to Andrew Pinski from comment #1)
> Why not just use { .foo = 0 }; instead?

Well I could do that, but I feel that it doesn't convey the message of "set all
fields to zero" as well, and it's also more verbose...

> Also this attribute is model after sparse's attribute, does sparse implement
> what you are asking (https://sparse.wiki.kernel.org/index.php/Main_Page)?

It seems that Sparse's behavior is the same as GCC's. It warns on '{ 0 }'.
(Note that in Sparse, the attribute must be specified after the closing brace.)

(In reply to Andrew Pinski from comment #2)
> I suspect this will be closed as won't fix.

Personally, I don't see any reason why this shouldn't be implemented. I think
almost all cases of '{ 0 }' are intended to initialize a structure to zero, not
just set the first element to 0. And '{ 0 }' will always do the same thing no
matter what the internal arrangement of the structure is.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug c/95379] Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute.
  2020-05-27 23:00 [Bug c/95379] New: Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute AsDaGo at posteo dot net
                   ` (2 preceding siblings ...)
  2020-05-28  3:28 ` AsDaGo at posteo dot net
@ 2020-05-28  7:41 ` rguenth at gcc dot gnu.org
  2020-05-28  9:05 ` amonakov at gcc dot gnu.org
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-05-28  7:41 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
           Severity|normal                      |enhancement

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug c/95379] Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute.
  2020-05-27 23:00 [Bug c/95379] New: Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute AsDaGo at posteo dot net
                   ` (3 preceding siblings ...)
  2020-05-28  7:41 ` rguenth at gcc dot gnu.org
@ 2020-05-28  9:05 ` amonakov at gcc dot gnu.org
  2020-05-28 13:13 ` tromey at gcc dot gnu.org
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: amonakov at gcc dot gnu.org @ 2020-05-28  9:05 UTC (permalink / raw)
  To: gcc-bugs

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

Alexander Monakov <amonakov at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amonakov at gcc dot gnu.org

--- Comment #4 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
> does anyone know if it's part of C too?

{ } is valid C++, invalid C; GCC accepts it in C as an extension, and warns
with -pedantic.

I think this enhancement request is reasonable.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug c/95379] Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute.
  2020-05-27 23:00 [Bug c/95379] New: Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute AsDaGo at posteo dot net
                   ` (4 preceding siblings ...)
  2020-05-28  9:05 ` amonakov at gcc dot gnu.org
@ 2020-05-28 13:13 ` tromey at gcc dot gnu.org
  2020-05-28 15:36 ` AsDaGo at posteo dot net
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: tromey at gcc dot gnu.org @ 2020-05-28 13:13 UTC (permalink / raw)
  To: gcc-bugs

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

Tom Tromey <tromey at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at gcc dot gnu.org

--- Comment #5 from Tom Tromey <tromey at gcc dot gnu.org> ---
(In reply to Asher Gordon from comment #3)

> It seems that Sparse's behavior is the same as GCC's. It warns on '{ 0 }'.
> (Note that in Sparse, the attribute must be specified after the closing
> brace.)

Since this warning is intended to work like sparse, introducing
a divergence here would seem to make the feature less useful,
in fact subverting the point of having it.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug c/95379] Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute.
  2020-05-27 23:00 [Bug c/95379] New: Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute AsDaGo at posteo dot net
                   ` (5 preceding siblings ...)
  2020-05-28 13:13 ` tromey at gcc dot gnu.org
@ 2020-05-28 15:36 ` AsDaGo at posteo dot net
  2020-05-28 15:43 ` tromey at gcc dot gnu.org
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: AsDaGo at posteo dot net @ 2020-05-28 15:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Asher Gordon <AsDaGo at posteo dot net> ---
(In reply to Tom Tromey from comment #5)
> Since this warning is intended to work like sparse, introducing
> a divergence here would seem to make the feature less useful,
> in fact subverting the point of having it.

How does diverging from Sparse make the feature less useful? If this is the
case, perhaps Sparse's behavior should be changed as well.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug c/95379] Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute.
  2020-05-27 23:00 [Bug c/95379] New: Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute AsDaGo at posteo dot net
                   ` (6 preceding siblings ...)
  2020-05-28 15:36 ` AsDaGo at posteo dot net
@ 2020-05-28 15:43 ` tromey at gcc dot gnu.org
  2020-05-28 16:29 ` AsDaGo at posteo dot net
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: tromey at gcc dot gnu.org @ 2020-05-28 15:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Tom Tromey <tromey at gcc dot gnu.org> ---
(In reply to Asher Gordon from comment #6)
> (In reply to Tom Tromey from comment #5)
> > Since this warning is intended to work like sparse, introducing
> > a divergence here would seem to make the feature less useful,
> > in fact subverting the point of having it.
> 
> How does diverging from Sparse make the feature less useful? If this is the
> case, perhaps Sparse's behavior should be changed as well.

The feature was added specifically to mimic what sparse does.
If sparse changes, I think changing gcc would be appropriate.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug c/95379] Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute.
  2020-05-27 23:00 [Bug c/95379] New: Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute AsDaGo at posteo dot net
                   ` (7 preceding siblings ...)
  2020-05-28 15:43 ` tromey at gcc dot gnu.org
@ 2020-05-28 16:29 ` AsDaGo at posteo dot net
  2020-05-28 19:25 ` luc.vanoostenryck at gmail dot com
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: AsDaGo at posteo dot net @ 2020-05-28 16:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Asher Gordon <AsDaGo at posteo dot net> ---
(In reply to Tom Tromey from comment #7)
> The feature was added specifically to mimic what sparse does.
> If sparse changes, I think changing gcc would be appropriate.

I just report a bug to Sparse here:
https://bugzilla.kernel.org/show_bug.cgi?id=207959

Let's see what they have to say.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug c/95379] Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute.
  2020-05-27 23:00 [Bug c/95379] New: Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute AsDaGo at posteo dot net
                   ` (8 preceding siblings ...)
  2020-05-28 16:29 ` AsDaGo at posteo dot net
@ 2020-05-28 19:25 ` luc.vanoostenryck at gmail dot com
  2020-05-28 20:48 ` pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: luc.vanoostenryck at gmail dot com @ 2020-05-28 19:25 UTC (permalink / raw)
  To: gcc-bugs

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

Luc Van Oostenryck <luc.vanoostenryck at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |luc.vanoostenryck at gmail dot com

--- Comment #9 from Luc Van Oostenryck <luc.vanoostenryck at gmail dot com> ---
In fact, sparse already support the suppression of the warning via the option
'-Wno-universal-initializer'.

It's really very recent and thus only in the mainline tree, not in a release
(and it was introduced for another warning but the result is the same).

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug c/95379] Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute.
  2020-05-27 23:00 [Bug c/95379] New: Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute AsDaGo at posteo dot net
                   ` (9 preceding siblings ...)
  2020-05-28 19:25 ` luc.vanoostenryck at gmail dot com
@ 2020-05-28 20:48 ` pinskia at gcc dot gnu.org
  2020-05-28 21:02 ` luc.vanoostenryck at gmail dot com
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: pinskia at gcc dot gnu.org @ 2020-05-28 20:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Luc Van Oostenryck from comment #9)
> In fact, sparse already support the suppression of the warning via the
> option '-Wno-universal-initializer'.
> 
> It's really very recent and thus only in the mainline tree, not in a release
> (and it was introduced for another warning but the result is the same).

GCC uses -Wno-designated-init to disable the warning (this option has been
there included for a while)?  Do you think sparse could add/use the same
option?

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug c/95379] Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute.
  2020-05-27 23:00 [Bug c/95379] New: Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute AsDaGo at posteo dot net
                   ` (10 preceding siblings ...)
  2020-05-28 20:48 ` pinskia at gcc dot gnu.org
@ 2020-05-28 21:02 ` luc.vanoostenryck at gmail dot com
  2020-05-28 21:15 ` AsDaGo at posteo dot net
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: luc.vanoostenryck at gmail dot com @ 2020-05-28 21:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Luc Van Oostenryck <luc.vanoostenryck at gmail dot com> ---
(In reply to Andrew Pinski from comment #10)
> GCC uses -Wno-designated-init to disable the warning (this option has been
> there included for a while)?  Do you think sparse could add/use the same
> option?

Sparse already has this option. Also, I don't think it would help here since
from I understand the OP want these warnings but not if they're caused by using
'{ 0 }'.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug c/95379] Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute.
  2020-05-27 23:00 [Bug c/95379] New: Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute AsDaGo at posteo dot net
                   ` (11 preceding siblings ...)
  2020-05-28 21:02 ` luc.vanoostenryck at gmail dot com
@ 2020-05-28 21:15 ` AsDaGo at posteo dot net
  2020-05-28 22:51 ` AsDaGo at posteo dot net
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: AsDaGo at posteo dot net @ 2020-05-28 21:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Asher Gordon <AsDaGo at posteo dot net> ---
(In reply to Luc Van Oostenryck from comment #11)
> Sparse already has this option. Also, I don't think it would help here since
> from I understand the OP want these warnings but not if they're caused by
> using '{ 0 }'.

That is correct. I want what is provided by '-Wdesignated-init
-Wno-universal-initializer'.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug c/95379] Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute.
  2020-05-27 23:00 [Bug c/95379] New: Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute AsDaGo at posteo dot net
                   ` (12 preceding siblings ...)
  2020-05-28 21:15 ` AsDaGo at posteo dot net
@ 2020-05-28 22:51 ` AsDaGo at posteo dot net
  2020-05-30 16:12 ` luc.vanoostenryck at gmail dot com
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: AsDaGo at posteo dot net @ 2020-05-28 22:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Asher Gordon <AsDaGo at posteo dot net> ---
Do you think that it would be possible to add something like Sparse's
-Wno-universal-initializer and use it by default? As Linus says here[1], Sparse
defaults tend to be kernel-centric, but I don't think there's any reason for
GCC to have the same defaults.

[1]  https://bugzilla.kernel.org/show_bug.cgi?id=207959#c4

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug c/95379] Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute.
  2020-05-27 23:00 [Bug c/95379] New: Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute AsDaGo at posteo dot net
                   ` (13 preceding siblings ...)
  2020-05-28 22:51 ` AsDaGo at posteo dot net
@ 2020-05-30 16:12 ` luc.vanoostenryck at gmail dot com
  2020-05-31 17:57 ` AsDaGo at posteo dot net
  2020-06-03 23:05 ` AsDaGo at posteo dot net
  16 siblings, 0 replies; 18+ messages in thread
From: luc.vanoostenryck at gmail dot com @ 2020-05-30 16:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from Luc Van Oostenryck <luc.vanoostenryck at gmail dot com> ---
(In reply to Tom Tromey from comment #7)
> The feature was added specifically to mimic what sparse does.
> If sparse changes, I think changing gcc would be appropriate.

Sparse warnings issued when using '{ 0 }' and not '{ }' were not really
intentional, but simply a consequence of how 'usual' initializers are
processed.

I think that '{ 0 }' and '{ }' should behave the same, they're just 2 way to
write the universal zero initializer, and thus there is no reasons to issue
theses warnings with '{ 0 }'.

I've now changed Sparse's default so that these warnings are not issued
anymore.

-- Luc

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug c/95379] Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute.
  2020-05-27 23:00 [Bug c/95379] New: Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute AsDaGo at posteo dot net
                   ` (14 preceding siblings ...)
  2020-05-30 16:12 ` luc.vanoostenryck at gmail dot com
@ 2020-05-31 17:57 ` AsDaGo at posteo dot net
  2020-06-03 23:05 ` AsDaGo at posteo dot net
  16 siblings, 0 replies; 18+ messages in thread
From: AsDaGo at posteo dot net @ 2020-05-31 17:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from Asher Gordon <AsDaGo at posteo dot net> ---
(In reply to Luc Van Oostenryck from comment #14)
> I've now changed Sparse's default so that these warnings are not issued
> anymore.

Thanks Luc.

(In reply to Tom Tromey from comment #7)
> The feature was added specifically to mimic what sparse does.
> If sparse changes, I think changing gcc would be appropriate.

Now there are a few things to consider: GCC currently treats '{ 0 }' specially
for -Wmissing-field-initializers (and maybe other warnings too). So if GCC adds
an option, -Wuniversal-initializer, should '-Wmissing-field-initializers
-Wuniversal-initializer' warn on '{ 0 }' (assuming that the struct being
initialized has more than one member)? Or alternatively, should
-Wdesignated-init treat '{ 0 }' specially, and no -Wuniversal-initializer
should be added?

Also, how should '{ 0, }' be treated? Sparse does not treat this specially
(i.e., it warns on '{ 0, }' with -Wdesignated-init). However, GCC does treat '{
0, }' specially (like '{ 0 }') for -Wmissing-field-initializers. Personally, I
think that Sparse's is the better behavior, since people will very rarely do '{
0, }' to mean "init to zero", and when people do use '{ 0, }', they probably
mean "init first member to zero". But I don't have a strong opinion on this,
and I don't think any special effort should be taken to avoid treating '{ 0, }'
like '{ 0 }'.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug c/95379] Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute.
  2020-05-27 23:00 [Bug c/95379] New: Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute AsDaGo at posteo dot net
                   ` (15 preceding siblings ...)
  2020-05-31 17:57 ` AsDaGo at posteo dot net
@ 2020-06-03 23:05 ` AsDaGo at posteo dot net
  16 siblings, 0 replies; 18+ messages in thread
From: AsDaGo at posteo dot net @ 2020-06-03 23:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from Asher Gordon <AsDaGo at posteo dot net> ---
I just submitted a patch here[1] to fix this bug. Note that I did not implement
-Wno-universal-initializer, I just made it behave like that by default.
However, it should be fairly easy to implement -Wno-universal-initializer now,
and if it is implemented, it should also affect -Wmissing-braces,
-Wmissing-field-initializers, and any other warning that currently treats '{ 0
}' specially.

[1]  https://gcc.gnu.org/pipermail/gcc-patches/2020-June/547222.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2020-06-03 23:05 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-27 23:00 [Bug c/95379] New: Don't warn about the universal zero initializer for a structure with the 'designated_init' attribute AsDaGo at posteo dot net
2020-05-28  2:14 ` [Bug c/95379] " pinskia at gcc dot gnu.org
2020-05-28  2:16 ` pinskia at gcc dot gnu.org
2020-05-28  3:28 ` AsDaGo at posteo dot net
2020-05-28  7:41 ` rguenth at gcc dot gnu.org
2020-05-28  9:05 ` amonakov at gcc dot gnu.org
2020-05-28 13:13 ` tromey at gcc dot gnu.org
2020-05-28 15:36 ` AsDaGo at posteo dot net
2020-05-28 15:43 ` tromey at gcc dot gnu.org
2020-05-28 16:29 ` AsDaGo at posteo dot net
2020-05-28 19:25 ` luc.vanoostenryck at gmail dot com
2020-05-28 20:48 ` pinskia at gcc dot gnu.org
2020-05-28 21:02 ` luc.vanoostenryck at gmail dot com
2020-05-28 21:15 ` AsDaGo at posteo dot net
2020-05-28 22:51 ` AsDaGo at posteo dot net
2020-05-30 16:12 ` luc.vanoostenryck at gmail dot com
2020-05-31 17:57 ` AsDaGo at posteo dot net
2020-06-03 23:05 ` AsDaGo at posteo dot net

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).