public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/60257] New: Incorrect column number and confusing message in -Woverride-init
@ 2014-02-18  5:53 chengniansun at gmail dot com
  2014-02-18  6:43 ` [Bug c/60257] " mpolacek at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: chengniansun at gmail dot com @ 2014-02-18  5:53 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60257
           Summary: Incorrect column number and confusing message in
                    -Woverride-init
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chengniansun at gmail dot com

I have two questions regarding -Woverride-init, 
1) the column number seems not right
        always starting from the beginning of the statement. 
2) the second message is confusing to me.
        is it trying to pinpoint the location where the field is first
initialized, similar to what Clang does?  


$: cat s.c
struct S {int i; int j;};
struct S s = {
  .j=4, .i=5, .i=6,
};
$: gcc-trunk -std=c99 -c -Woverride-init s.c
s.c:3:3: warning: initialized field overwritten [-Woverride-init]
   .j=4, .i=5, .i=6,
   ^
s.c:3:3: warning: (near initialization for ‘s.i’) [-Woverride-init]

$: clang-trunk -std=c99 -Winitializer-overrides -c s.c
s.c:3:18: warning: initializer overrides prior initialization of this subobject
[-Winitializer-overrides]
  .j=4, .i=5, .i=6,
                 ^
s.c:3:12: note: previous initialization is here
  .j=4, .i=5, .i=6,
           ^
1 warning generated.
>From gcc-bugs-return-444005-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Feb 18 06:32:26 2014
Return-Path: <gcc-bugs-return-444005-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 28121 invoked by alias); 18 Feb 2014 06:32:25 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 28078 invoked by uid 48); 18 Feb 2014 06:32:20 -0000
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/60250] [4.9 Regression] [c++1y] ICE using lambda for array size
Date: Tue, 18 Feb 2014 06:32:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jakub at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on cc everconfirmed
Message-ID: <bug-60250-4-Lpfd3QnlxX@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60250-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60250-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-02/txt/msg01762.txt.bz2
Content-length: 636

http://gcc.gnu.org/bugzilla/show_bug.cgi?id`250

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-02-18
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |jason at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r200279.


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

* [Bug c/60257] Incorrect column number and confusing message in -Woverride-init
  2014-02-18  5:53 [Bug c/60257] New: Incorrect column number and confusing message in -Woverride-init chengniansun at gmail dot com
@ 2014-02-18  6:43 ` mpolacek at gcc dot gnu.org
  2014-04-25 19:25 ` mpolacek at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-02-18  6:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2014-02-18
                 CC|                            |mpolacek at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Mine.


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

* [Bug c/60257] Incorrect column number and confusing message in -Woverride-init
  2014-02-18  5:53 [Bug c/60257] New: Incorrect column number and confusing message in -Woverride-init chengniansun at gmail dot com
  2014-02-18  6:43 ` [Bug c/60257] " mpolacek at gcc dot gnu.org
@ 2014-04-25 19:25 ` mpolacek at gcc dot gnu.org
  2014-05-01  7:35 ` mpolacek at gcc dot gnu.org
  2014-05-01  7:36 ` mpolacek at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-04-25 19:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
(In reply to Chengnian Sun from comment #0)
> 2) the second message is confusing to me.
>         is it trying to pinpoint the location where the field is first
> initialized, similar to what Clang does?  

I don't think so, unfortunately.  It seems kind of redundant now with caret
diagnostics.


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

* [Bug c/60257] Incorrect column number and confusing message in -Woverride-init
  2014-02-18  5:53 [Bug c/60257] New: Incorrect column number and confusing message in -Woverride-init chengniansun at gmail dot com
  2014-02-18  6:43 ` [Bug c/60257] " mpolacek at gcc dot gnu.org
  2014-04-25 19:25 ` mpolacek at gcc dot gnu.org
@ 2014-05-01  7:35 ` mpolacek at gcc dot gnu.org
  2014-05-01  7:36 ` mpolacek at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-05-01  7:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Author: mpolacek
Date: Thu May  1 07:35:05 2014
New Revision: 209974

URL: http://gcc.gnu.org/viewcvs?rev=209974&root=gcc&view=rev
Log:
    PR c/60257
    * c-typeck.c (warning_init): Add location_t parameter.  Call
    warning_at instead of warning.
    (push_init_level): Pass input_location to warning_init.
    (add_pending_init): Add location_t parameter.  Pass loc to
    warning_init.
    (set_nonincremental_init): Pass input_location to add_pending_init.
    (set_nonincremental_init_from_string): Likewise.
    (output_init_element): Pass loc to warning_init and to
    add_pending_init.

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

Added:
    trunk/gcc/testsuite/gcc.dg/pr60257.c
Modified:
    trunk/gcc/c/ChangeLog
    trunk/gcc/c/c-typeck.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c/60257] Incorrect column number and confusing message in -Woverride-init
  2014-02-18  5:53 [Bug c/60257] New: Incorrect column number and confusing message in -Woverride-init chengniansun at gmail dot com
                   ` (2 preceding siblings ...)
  2014-05-01  7:35 ` mpolacek at gcc dot gnu.org
@ 2014-05-01  7:36 ` mpolacek at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-05-01  7:36 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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


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

end of thread, other threads:[~2014-05-01  7:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-18  5:53 [Bug c/60257] New: Incorrect column number and confusing message in -Woverride-init chengniansun at gmail dot com
2014-02-18  6:43 ` [Bug c/60257] " mpolacek at gcc dot gnu.org
2014-04-25 19:25 ` mpolacek at gcc dot gnu.org
2014-05-01  7:35 ` mpolacek at gcc dot gnu.org
2014-05-01  7:36 ` 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).