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

* [Bug c/39525] [easy to fix bug] Docs for C99 "designated initializers" isn't clear what happens to omitted field members
  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 ` pinskia at gcc dot gnu dot org
  2009-03-23 13:48 ` mnemo at minimum dot se
  1 sibling, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-03-23 13:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2009-03-23 13:30 -------
Hmm, how so?  The C standard is clear that these fields are zero initialized if
omitted.


-- 


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


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

* [Bug c/39525] [easy to fix bug] Docs for C99 "designated initializers" isn't clear what happens to omitted field members
  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
  1 sibling, 0 replies; 6+ messages in thread
From: mnemo at minimum dot se @ 2009-03-23 13:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from mnemo at minimum dot se  2009-03-23 13:48 -------
If you could just add that info in a single sentence to the GCC docs, it would
be very helpful for end users. Thanks.


-- 


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


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

* [Bug c/39525] [easy to fix bug] Docs for C99 "designated initializers" isn't clear what happens to omitted field members
       [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
  2 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-03-26  6:59 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed.


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

* [Bug c/39525] [easy to fix bug] Docs for C99 "designated initializers" isn't clear what happens to omitted field members
       [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
  2 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-03-26  6:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Author: mpolacek
Date: Wed Mar 26 06:55:39 2014
New Revision: 208835

URL: http://gcc.gnu.org/viewcvs?rev=208835&root=gcc&view=rev
Log:
    PR c/39525
    * doc/extend.texi (Designated Inits): Describe what happens to omitted
    field members.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/doc/extend.texi


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

* [Bug c/39525] [easy to fix bug] Docs for C99 "designated initializers" isn't clear what happens to omitted field members
       [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
  2 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-03-25 22:02 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2014-03-25
                 CC|                            |mpolacek at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |mpolacek at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I've posted a patch for this:
http://gcc.gnu.org/ml/gcc-patches/2014-03/msg01383.html


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

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