public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "gcc at haasn dot dev" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/103738] New: No warning when setting deprecated fields using designated initializers Date: Wed, 15 Dec 2021 21:00:38 +0000 [thread overview] Message-ID: <bug-103738-4@http.gcc.gnu.org/bugzilla/> (raw) 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)); | ^~~
next reply other threads:[~2021-12-15 21:00 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-12-15 21:00 gcc at haasn dot dev [this message] 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
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-103738-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).