public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/59855] New: Support sparse-style __attribute__((designated_init)) on structures, requiring designated initializers
@ 2014-01-17  8:37 josh at joshtriplett dot org
  2014-01-20 20:43 ` [Bug c/59855] " tromey at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: josh at joshtriplett dot org @ 2014-01-17  8:37 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59855

            Bug ID: 59855
           Summary: Support sparse-style __attribute__((designated_init))
                    on structures, requiring designated initializers
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: josh at joshtriplett dot org

Created attachment 31865
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31865&action=edit
Sparse test case for __attribute__((designated_init))

The Sparse static analyzer provides an extension to force designated
initialization of a structure, __attribute__((designated_init)).  Given a
structure declared with this attribute, Sparse warns if any instance of that
structure gets initialized using a positional initializer, rather than a
designated initializer.  This is useful for structure types likely to change
layout or gain additional fields in the future, to make initializers of the
structure more resilient.

It would help greatly if GCC could support this attribute as well, to make the
warnings more generally available and visible to developers who aren't using
sparse at compilation time.

I've attached Sparse's test case for designated_init, which provides
comprehensive coverage of cases that should and shouldn't generate warnings.


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

end of thread, other threads:[~2014-08-02  5:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-17  8:37 [Bug c/59855] New: Support sparse-style __attribute__((designated_init)) on structures, requiring designated initializers josh at joshtriplett dot org
2014-01-20 20:43 ` [Bug c/59855] " tromey at gcc dot gnu.org
2014-01-20 23:01 ` josh at joshtriplett dot org
2014-07-30 15:04 ` tromey at gcc dot gnu.org
2014-07-30 15:06 ` tromey at gcc dot gnu.org
2014-07-31 18:08 ` josh at joshtriplett dot org
2014-07-31 18:12 ` mpolacek at gcc dot gnu.org
2014-08-02  5:53 ` mpolacek 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).