public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/36446] unexplained warning in struct initialization
       [not found] <bug-36446-4@http.gcc.gnu.org/bugzilla/>
@ 2012-04-18 12:58 ` vadmium+gc at gmail dot com
  2012-04-18 13:28 ` manu at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: vadmium+gc at gmail dot com @ 2012-04-18 12:58 UTC (permalink / raw)
  To: gcc-bugs

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

Marty <vadmium+gc at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vadmium+gc at gmail dot com

--- Comment #3 from Marty <vadmium+gc at gmail dot com> 2012-04-18 12:26:38 UTC ---
Possibly related: Bug 30006, Bug 47772


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

* [Bug c/36446] unexplained warning in struct initialization
       [not found] <bug-36446-4@http.gcc.gnu.org/bugzilla/>
  2012-04-18 12:58 ` [Bug c/36446] unexplained warning in struct initialization vadmium+gc at gmail dot com
@ 2012-04-18 13:28 ` manu at gcc dot gnu.org
  2012-04-18 13:40 ` manu at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: manu at gcc dot gnu.org @ 2012-04-18 13:28 UTC (permalink / raw)
  To: gcc-bugs

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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-04-18
               Host|i386-redhat-linux           |
     Ever Confirmed|0                           |1

--- Comment #4 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-04-18 13:19:49 UTC ---
manuel@gcc12:~$ ~/trunk/186353/build/gcc/cc1 -Wextra pr36446.c
pr36446.c:13:3: warning: missing initializer [-Wmissing-field-initializers]
   .c = 2,
   ^
pr36446.c:13:3: warning: (near initialization for ‘m1.h.b’)
[-Wmissing-field-initializers]
   .c = 2,
   ^

Apart from the warnings, there are several things wrong with this:

* The second message should use inform() and check the output of warning().

* The first message should say "missing initializer for field '.h.b'", and the
second should say "'struct h' defined here".

For comparison, this is what Clang prints when the warning is valid:

pr36446.c:12:10: warning: missing field 'b' initializer
[-Wmissing-field-initializers]
  .h = {1},
         ^
1 warning generated.


I don't think this bug is hard to fix, but unfortunately, I don't have time to
work on them. So if anyone here can help, this may get fixed for GCC 4.8. 

The first step is to launch gdb, find where the warning text is given, and put
a breakpoint at the call to warning(). Then figure out why the conditions for
warning are satisfied. Even if you cannot code a patch, this information would
be useful.


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

* [Bug c/36446] unexplained warning in struct initialization
       [not found] <bug-36446-4@http.gcc.gnu.org/bugzilla/>
  2012-04-18 12:58 ` [Bug c/36446] unexplained warning in struct initialization vadmium+gc at gmail dot com
  2012-04-18 13:28 ` manu at gcc dot gnu.org
@ 2012-04-18 13:40 ` manu at gcc dot gnu.org
  2012-04-18 14:05 ` manu at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: manu at gcc dot gnu.org @ 2012-04-18 13:40 UTC (permalink / raw)
  To: gcc-bugs

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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |darren at kulp dot ch
                 CC|                            |yar at bsd dot chem.msu.ru

--- Comment #5 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-04-18 13:23:53 UTC ---
*** Bug 47772 has been marked as a duplicate of this bug. ***

--- Comment #6 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-04-18 13:25:13 UTC ---
*** Bug 30006 has been marked as a duplicate of this bug. ***


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

* [Bug c/36446] unexplained warning in struct initialization
       [not found] <bug-36446-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2012-04-18 13:40 ` manu at gcc dot gnu.org
@ 2012-04-18 14:05 ` manu at gcc dot gnu.org
  2014-06-09  9:41 ` mpolacek at gcc dot gnu.org
  2014-06-09 20:37 ` mpolacek at gcc dot gnu.org
  5 siblings, 0 replies; 8+ messages in thread
From: manu at gcc dot gnu.org @ 2012-04-18 14:05 UTC (permalink / raw)
  To: gcc-bugs

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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |darren at kulp dot ch
                 CC|                            |yar at bsd dot chem.msu.ru

--- Comment #5 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-04-18 13:23:53 UTC ---
*** Bug 47772 has been marked as a duplicate of this bug. ***

--- Comment #6 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-04-18 13:25:13 UTC ---
*** Bug 30006 has been marked as a duplicate of this bug. ***


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

* [Bug c/36446] unexplained warning in struct initialization
       [not found] <bug-36446-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2012-04-18 14:05 ` manu at gcc dot gnu.org
@ 2014-06-09  9:41 ` mpolacek at gcc dot gnu.org
  2014-06-09 20:37 ` mpolacek at gcc dot gnu.org
  5 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-06-09  9:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36446

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |mpolacek at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |mpolacek at gcc dot gnu.org
   Target Milestone|---                         |4.10.0

--- Comment #7 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
The bogus warning was fixed recently and I'm testing a patch for error/warning
-> inform change.


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

* [Bug c/36446] unexplained warning in struct initialization
       [not found] <bug-36446-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2014-06-09  9:41 ` mpolacek at gcc dot gnu.org
@ 2014-06-09 20:37 ` mpolacek at gcc dot gnu.org
  5 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-06-09 20:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36446

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

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

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


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

* [Bug c/36446] unexplained warning in struct initialization
  2008-06-05 21:59 [Bug c/36446] New: " geoffrey dot levand at am dot sony dot com
  2008-06-05 22:00 ` [Bug c/36446] " pinskia at gcc dot gnu dot org
@ 2008-06-05 22:02 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-06-05 22:02 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 566 bytes --]



------- Comment #2 from pinskia at gcc dot gnu dot org  2008-06-05 22:01 -------
On the trunk we get:
t.c:13: warning: missing initializer
t.c:13: warning: (near initialization for ‘m1.h.b’)

Which seems wrong as we don't get the warning for m2 and if we add an
initializer for m1.h.b we get a different warning:
t.c:13: warning: missing initializer
t.c:13: warning: (near initialization for ‘m1.h.b’)
t.c:14: warning: initialized field overwritten
t.c:14: warning: (near initialization for ‘m1.h’)


-- 


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


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

* [Bug c/36446] unexplained warning in struct initialization
  2008-06-05 21:59 [Bug c/36446] New: " geoffrey dot levand at am dot sony dot com
@ 2008-06-05 22:00 ` pinskia at gcc dot gnu dot org
  2008-06-05 22:02 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-06-05 22:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2008-06-05 21:59 -------
Also seen on the trunk (4.4.0).


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
           Keywords|                            |diagnostic
            Version|4.2.1                       |4.1.1


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


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

end of thread, other threads:[~2014-06-09 20:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-36446-4@http.gcc.gnu.org/bugzilla/>
2012-04-18 12:58 ` [Bug c/36446] unexplained warning in struct initialization vadmium+gc at gmail dot com
2012-04-18 13:28 ` manu at gcc dot gnu.org
2012-04-18 13:40 ` manu at gcc dot gnu.org
2012-04-18 14:05 ` manu at gcc dot gnu.org
2014-06-09  9:41 ` mpolacek at gcc dot gnu.org
2014-06-09 20:37 ` mpolacek at gcc dot gnu.org
2008-06-05 21:59 [Bug c/36446] New: " geoffrey dot levand at am dot sony dot com
2008-06-05 22:00 ` [Bug c/36446] " pinskia at gcc dot gnu dot org
2008-06-05 22:02 ` pinskia at gcc dot gnu dot 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).