public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug c/103738] New: No warning when setting deprecated fields using designated initializers @ 2021-12-15 21:00 gcc at haasn dot dev 2021-12-15 21:01 ` [Bug c/103738] " gcc at haasn dot dev ` (2 more replies) 0 siblings, 3 replies; 4+ messages in thread From: gcc at haasn dot dev @ 2021-12-15 21:00 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103738 Bug ID: 103738 Summary: No warning when setting deprecated fields using designated initializers Product: gcc Version: 11.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: gcc at haasn dot dev Target Milestone: --- Created attachment 52009 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52009&action=edit No deprecation warning produced Deprecated attributes on struct members are ignored when setting those fields using designated initializers. The attached example should produce a warning, but it does not. Contrast the following alternative code: struct foo foo; foo.bar = 5; This does produce a deprecation warning as expected: no_warning.c: In function ‘main’: no_warning.c:8:5: warning: ‘bar’ is deprecated [-Wdeprecated-declarations] 8 | foo.bar = 5; | ^~~ no_warning.c:2:9: note: declared here 2 | int bar __attribute((deprecated)); | ^~~ ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c/103738] No warning when setting deprecated fields using designated initializers 2021-12-15 21:00 [Bug c/103738] New: No warning when setting deprecated fields using designated initializers gcc at haasn dot dev @ 2021-12-15 21:01 ` gcc at haasn dot dev 2021-12-15 21:02 ` gcc at haasn dot dev 2021-12-15 21:15 ` pinskia at gcc dot gnu.org 2 siblings, 0 replies; 4+ messages in thread From: gcc at haasn dot dev @ 2021-12-15 21:01 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103738 Niklas Haas <gcc at haasn dot dev> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #52009|no_warning.c |warning.c filename| | Attachment #52009|No deprecation warning |Deprecation warning description|produced |produced --- Comment #1 from Niklas Haas <gcc at haasn dot dev> --- Comment on attachment 52009 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52009 Deprecation warning produced Accidentally attached the wrong version of the file, fixing. ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c/103738] No warning when setting deprecated fields using designated initializers 2021-12-15 21:00 [Bug c/103738] New: No warning when setting deprecated fields using designated initializers gcc at haasn dot dev 2021-12-15 21:01 ` [Bug c/103738] " gcc at haasn dot dev @ 2021-12-15 21:02 ` gcc at haasn dot dev 2021-12-15 21:15 ` pinskia at gcc dot gnu.org 2 siblings, 0 replies; 4+ messages in thread From: gcc at haasn dot dev @ 2021-12-15 21:02 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103738 --- Comment #2 from Niklas Haas <gcc at haasn dot dev> --- Created attachment 52010 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52010&action=edit No deprecation warning produced ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c/103738] No warning when setting deprecated fields using designated initializers 2021-12-15 21:00 [Bug c/103738] New: No warning when setting deprecated fields using designated initializers gcc at haasn dot dev 2021-12-15 21:01 ` [Bug c/103738] " gcc at haasn dot dev 2021-12-15 21:02 ` gcc at haasn dot dev @ 2021-12-15 21:15 ` pinskia at gcc dot gnu.org 2 siblings, 0 replies; 4+ messages in thread From: pinskia at gcc dot gnu.org @ 2021-12-15 21:15 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103738 Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2021-12-15 Keywords| |diagnostic Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Confirmed. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-12-15 21:15 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-12-15 21:00 [Bug c/103738] New: No warning when setting deprecated fields using designated initializers gcc at haasn dot dev 2021-12-15 21:01 ` [Bug c/103738] " gcc at haasn dot dev 2021-12-15 21:02 ` gcc at haasn dot dev 2021-12-15 21:15 ` pinskia at gcc dot gnu.org
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).