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

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).