public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/36489]  New: Warning "initialized field overwritten" wrongly triggers with multidimensional arrays
@ 2008-06-10 16:26 smeuuh at gmail dot com
  2008-12-28  1:21 ` [Bug c/36489] [4.3/4.4 Regression] " pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 12+ messages in thread
From: smeuuh at gmail dot com @ 2008-06-10 16:26 UTC (permalink / raw)
  To: gcc-bugs

Hi,
This code :
int t[10][10] = {
                [1][2] = 1,
                [1][3] = 2
        };
warns with "initialized field overwritten" under -Wextra with gcc 4.3.0,
although it's perfectly valid.
Antoine Levitt


-- 
           Summary: Warning "initialized field overwritten" wrongly triggers
                    with multidimensional arrays
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: smeuuh at gmail dot com
 GCC build triplet: i386-pc-linux
  GCC host triplet: i386-pc-linux
GCC target triplet: i386-pc-linux


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


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

* [Bug c/36489] [4.3/4.4 Regression] Warning "initialized field overwritten" wrongly triggers with multidimensional arrays
  2008-06-10 16:26 [Bug c/36489] New: Warning "initialized field overwritten" wrongly triggers with multidimensional arrays smeuuh at gmail dot com
@ 2008-12-28  1:21 ` pinskia at gcc dot gnu dot org
  2008-12-29 16:42 ` jakub at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-28  1:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2008-12-28 01:19 -------
Confirmed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |diagnostic
      Known to fail|                            |4.3.0 4.4.0 4.3.2 4.3.3
      Known to work|                            |4.1.1 4.0.2
   Last reconfirmed|0000-00-00 00:00:00         |2008-12-28 01:19:04
               date|                            |
            Summary|Warning "initialized field  |[4.3/4.4 Regression] Warning
                   |overwritten" wrongly        |"initialized field
                   |triggers with               |overwritten" wrongly
                   |multidimensional arrays     |triggers with
                   |                            |multidimensional arrays
   Target Milestone|---                         |4.3.3
            Version|unknown                     |4.3.0


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


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

* [Bug c/36489] [4.3/4.4 Regression] Warning "initialized field overwritten" wrongly triggers with multidimensional arrays
  2008-06-10 16:26 [Bug c/36489] New: Warning "initialized field overwritten" wrongly triggers with multidimensional arrays smeuuh at gmail dot com
  2008-12-28  1:21 ` [Bug c/36489] [4.3/4.4 Regression] " pinskia at gcc dot gnu dot org
@ 2008-12-29 16:42 ` jakub at gcc dot gnu dot org
  2008-12-29 21:51 ` rguenth at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-12-29 16:42 UTC (permalink / raw)
  To: gcc-bugs



-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2008-12-28 01:19:04         |2008-12-29 16:40:35
               date|                            |


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


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

* [Bug c/36489] [4.3/4.4 Regression] Warning "initialized field overwritten" wrongly triggers with multidimensional arrays
  2008-06-10 16:26 [Bug c/36489] New: Warning "initialized field overwritten" wrongly triggers with multidimensional arrays smeuuh at gmail dot com
  2008-12-28  1:21 ` [Bug c/36489] [4.3/4.4 Regression] " pinskia at gcc dot gnu dot org
  2008-12-29 16:42 ` jakub at gcc dot gnu dot org
@ 2008-12-29 21:51 ` rguenth at gcc dot gnu dot org
  2009-01-01 19:42 ` jakub at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-12-29 21:51 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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


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

* [Bug c/36489] [4.3/4.4 Regression] Warning "initialized field overwritten" wrongly triggers with multidimensional arrays
  2008-06-10 16:26 [Bug c/36489] New: Warning "initialized field overwritten" wrongly triggers with multidimensional arrays smeuuh at gmail dot com
                   ` (2 preceding siblings ...)
  2008-12-29 21:51 ` rguenth at gcc dot gnu dot org
@ 2009-01-01 19:42 ` jakub at gcc dot gnu dot org
  2009-01-01 19:46 ` [Bug c/36489] [4.3 " jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-01-01 19:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jakub at gcc dot gnu dot org  2009-01-01 19:41 -------
Subject: Bug 36489

Author: jakub
Date: Thu Jan  1 19:40:03 2009
New Revision: 142998

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142998
Log:
        PR c/36489
        * c-typeck.c (add_pending_init): Add IMPLICIT argument.  Only
        warn about overwriting initializer with side-effects or
        -Woverride-init if !IMPLICIT.
        (output_init_element): Likewise.  Pass IMPLICIT down to
        add_pending_init.
        (process_init_element): Add IMPLICIT argument.  Pass it down
        to output_init_element.
        (push_init_element, pop_init_level, set_designator): Adjust
        process_init_element callers.
        (set_nonincremental_init, set_nonincremental_init_from_string):
        Adjust add_pending_init callers.
        (output_pending_init_elements): Adjust output_init_element callers.
        * c-tree.h (process_init_element): Adjust prototype.
        * c-parser.c (c_parser_initelt, c_parser_initval): Adjust
        process_init_element callers.

        * gcc.dg/pr36489.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr36489.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-parser.c
    trunk/gcc/c-tree.h
    trunk/gcc/c-typeck.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c/36489] [4.3 Regression] Warning "initialized field overwritten" wrongly triggers with multidimensional arrays
  2008-06-10 16:26 [Bug c/36489] New: Warning "initialized field overwritten" wrongly triggers with multidimensional arrays smeuuh at gmail dot com
                   ` (3 preceding siblings ...)
  2009-01-01 19:42 ` jakub at gcc dot gnu dot org
@ 2009-01-01 19:46 ` jakub at gcc dot gnu dot org
  2009-01-24 10:25 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-01-01 19:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jakub at gcc dot gnu dot org  2009-01-01 19:44 -------
Fixed on the trunk so far.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|4.3.0 4.4.0 4.3.2 4.3.3     |4.3.0 4.3.2 4.3.3
      Known to work|4.1.1 4.0.2                 |4.1.1 4.0.2 4.4.0
            Summary|[4.3/4.4 Regression] Warning|[4.3 Regression] Warning
                   |"initialized field          |"initialized field
                   |overwritten" wrongly        |overwritten" wrongly
                   |triggers with               |triggers with
                   |multidimensional arrays     |multidimensional arrays


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


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

* [Bug c/36489] [4.3 Regression] Warning "initialized field overwritten" wrongly triggers with multidimensional arrays
  2008-06-10 16:26 [Bug c/36489] New: Warning "initialized field overwritten" wrongly triggers with multidimensional arrays smeuuh at gmail dot com
                   ` (4 preceding siblings ...)
  2009-01-01 19:46 ` [Bug c/36489] [4.3 " jakub at gcc dot gnu dot org
@ 2009-01-24 10:25 ` rguenth at gcc dot gnu dot org
  2009-08-04 12:41 ` rguenth at gcc dot gnu dot org
  2010-05-22 18:31 ` rguenth at gcc dot gnu dot org
  7 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-01-24 10:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2009-01-24 10:20 -------
GCC 4.3.3 is being released, adjusting target milestone.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.3.3                       |4.3.4


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


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

* [Bug c/36489] [4.3 Regression] Warning "initialized field overwritten" wrongly triggers with multidimensional arrays
  2008-06-10 16:26 [Bug c/36489] New: Warning "initialized field overwritten" wrongly triggers with multidimensional arrays smeuuh at gmail dot com
                   ` (5 preceding siblings ...)
  2009-01-24 10:25 ` rguenth at gcc dot gnu dot org
@ 2009-08-04 12:41 ` rguenth at gcc dot gnu dot org
  2010-05-22 18:31 ` rguenth at gcc dot gnu dot org
  7 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-08-04 12:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rguenth at gcc dot gnu dot org  2009-08-04 12:29 -------
GCC 4.3.4 is being released, adjusting target milestone.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.3.4                       |4.3.5


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


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

* [Bug c/36489] [4.3 Regression] Warning "initialized field overwritten" wrongly triggers with multidimensional arrays
  2008-06-10 16:26 [Bug c/36489] New: Warning "initialized field overwritten" wrongly triggers with multidimensional arrays smeuuh at gmail dot com
                   ` (6 preceding siblings ...)
  2009-08-04 12:41 ` rguenth at gcc dot gnu dot org
@ 2010-05-22 18:31 ` rguenth at gcc dot gnu dot org
  7 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-05-22 18:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from rguenth at gcc dot gnu dot org  2010-05-22 18:12 -------
GCC 4.3.5 is being released, adjusting target milestone.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.3.5                       |4.3.6


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


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

* [Bug c/36489] [4.3 Regression] Warning "initialized field overwritten" wrongly triggers with multidimensional arrays
       [not found] <bug-36489-4@http.gcc.gnu.org/bugzilla/>
  2010-11-09 15:52 ` ian at linux dot vnet.ibm.com
  2011-06-27 11:55 ` rguenth at gcc dot gnu.org
@ 2011-08-19 23:20 ` visionofarun at gmail dot com
  2 siblings, 0 replies; 12+ messages in thread
From: visionofarun at gmail dot com @ 2011-08-19 23:20 UTC (permalink / raw)
  To: gcc-bugs

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

Arun Chandrasekaran <visionofarun at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |visionofarun at gmail dot
                   |                            |com

--- Comment #9 from Arun Chandrasekaran <visionofarun at gmail dot com> 2011-08-19 23:04:24 UTC ---
The bug is still persistent in GCC 4.5.2.


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

* [Bug c/36489] [4.3 Regression] Warning "initialized field overwritten" wrongly triggers with multidimensional arrays
       [not found] <bug-36489-4@http.gcc.gnu.org/bugzilla/>
  2010-11-09 15:52 ` ian at linux dot vnet.ibm.com
@ 2011-06-27 11:55 ` rguenth at gcc dot gnu.org
  2011-08-19 23:20 ` visionofarun at gmail dot com
  2 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-06-27 11:55 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
      Known to work|                            |
         Resolution|                            |FIXED
   Target Milestone|4.3.6                       |4.4.0
      Known to fail|                            |

--- Comment #8 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-06-27 11:27:57 UTC ---
Fixed for 4.4.0.


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

* [Bug c/36489] [4.3 Regression] Warning "initialized field overwritten" wrongly triggers with multidimensional arrays
       [not found] <bug-36489-4@http.gcc.gnu.org/bugzilla/>
@ 2010-11-09 15:52 ` ian at linux dot vnet.ibm.com
  2011-06-27 11:55 ` rguenth at gcc dot gnu.org
  2011-08-19 23:20 ` visionofarun at gmail dot com
  2 siblings, 0 replies; 12+ messages in thread
From: ian at linux dot vnet.ibm.com @ 2010-11-09 15:52 UTC (permalink / raw)
  To: gcc-bugs

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

Jan Kunigk <ian at linux dot vnet.ibm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ian at linux dot
                   |                            |vnet.ibm.com

--- Comment #7 from Jan Kunigk <ian at linux dot vnet.ibm.com> 2010-11-09 15:51:44 UTC ---
Stumbled into this again w 4.3.4

echo "int t[10][10] = { [1][2] = 1, [1][3] = 2 };" > bla.c

powerpc64-unknown-linux-gnu-gcc -Wextra -c bla.c           
bla.c:1: warning: initialized field overwritten
bla.c:1: warning: (near initialization for 't[1]')

powerpc64-unknown-linux-gnu-gcc --version
powerpc64-unknown-linux-gnu-gcc (Gentoo 4.3.4 p1.1, pie-10.1.5) 4.3.4
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Cheers


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

end of thread, other threads:[~2011-08-19 23:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-10 16:26 [Bug c/36489] New: Warning "initialized field overwritten" wrongly triggers with multidimensional arrays smeuuh at gmail dot com
2008-12-28  1:21 ` [Bug c/36489] [4.3/4.4 Regression] " pinskia at gcc dot gnu dot org
2008-12-29 16:42 ` jakub at gcc dot gnu dot org
2008-12-29 21:51 ` rguenth at gcc dot gnu dot org
2009-01-01 19:42 ` jakub at gcc dot gnu dot org
2009-01-01 19:46 ` [Bug c/36489] [4.3 " jakub at gcc dot gnu dot org
2009-01-24 10:25 ` rguenth at gcc dot gnu dot org
2009-08-04 12:41 ` rguenth at gcc dot gnu dot org
2010-05-22 18:31 ` rguenth at gcc dot gnu dot org
     [not found] <bug-36489-4@http.gcc.gnu.org/bugzilla/>
2010-11-09 15:52 ` ian at linux dot vnet.ibm.com
2011-06-27 11:55 ` rguenth at gcc dot gnu.org
2011-08-19 23:20 ` visionofarun at gmail dot com

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