public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/39525]  New: [easy to fix bug] Docs for C99 "designated initializers" isn't clear what happens to omitted field members
@ 2009-03-23 11:10 mnemo at minimum dot se
  2009-03-23 13:30 ` [Bug c/39525] " pinskia at gcc dot gnu dot org
  2009-03-23 13:48 ` mnemo at minimum dot se
  0 siblings, 2 replies; 6+ messages in thread
From: mnemo at minimum dot se @ 2009-03-23 11:10 UTC (permalink / raw)
  To: gcc-bugs

The documentation for C99 "designated initializers" is not clear what happens
to omitted field members. I'm fairly sure omitted field members get initialized
to the same value they would get if they were static but it would be very nice
to have this explicitly called out in the docs.

The documentation page I'm referring to is available here:
http://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html

In particular I would like the documentation to explain what the values of

struct my_struct { bool a; int b; double c; };
struct my_struct ms = { .b = 42 };

At this point, what is the values of ms.a and ms.c? As I mention above, I
suspect the answer is that they have been initialized to the same values that
the corresponding data types would get if they were static variables? i.e.
false and 0.0, no?


-- 
           Summary: [easy to fix bug] Docs for C99 "designated initializers"
                    isn't clear what happens to omitted field members
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mnemo at minimum dot se


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


^ permalink raw reply	[flat|nested] 6+ messages in thread
[parent not found: <bug-39525-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2014-03-26  6:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-23 11:10 [Bug c/39525] New: [easy to fix bug] Docs for C99 "designated initializers" isn't clear what happens to omitted field members mnemo at minimum dot se
2009-03-23 13:30 ` [Bug c/39525] " pinskia at gcc dot gnu dot org
2009-03-23 13:48 ` mnemo at minimum dot se
     [not found] <bug-39525-4@http.gcc.gnu.org/bugzilla/>
2014-03-25 22:02 ` mpolacek at gcc dot gnu.org
2014-03-26  6:56 ` mpolacek at gcc dot gnu.org
2014-03-26  6:59 ` 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).