public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/36750] -Wmissing-field-initializers relaxation request
       [not found] <bug-36750-4@http.gcc.gnu.org/bugzilla/>
@ 2010-11-24 12:35 ` P at draigBrady dot com
  2010-11-24 14:29 ` manu at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: P at draigBrady dot com @ 2010-11-24 12:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Pádraig Brady <P at draigBrady dot com> 2010-11-24 12:09:33 UTC ---
A related thread: http://gcc.gnu.org/ml/gcc-bugs/1998-07/msg00031.html


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

* [Bug c/36750] -Wmissing-field-initializers relaxation request
       [not found] <bug-36750-4@http.gcc.gnu.org/bugzilla/>
  2010-11-24 12:35 ` [Bug c/36750] -Wmissing-field-initializers relaxation request P at draigBrady dot com
@ 2010-11-24 14:29 ` manu at gcc dot gnu.org
  2011-04-22 11:53 ` amonakov at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: manu at gcc dot gnu.org @ 2010-11-24 14:29 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2010.11.24 14:18:07
                 CC|                            |manu at gcc dot gnu.org
     Ever Confirmed|0                           |1

--- Comment #2 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2010-11-24 14:18:07 UTC ---
I think this is reasonable. Have you tried what clang does in these cases?

But the mail that you link talks about C++ not C...


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

* [Bug c/36750] -Wmissing-field-initializers relaxation request
       [not found] <bug-36750-4@http.gcc.gnu.org/bugzilla/>
  2010-11-24 12:35 ` [Bug c/36750] -Wmissing-field-initializers relaxation request P at draigBrady dot com
  2010-11-24 14:29 ` manu at gcc dot gnu.org
@ 2011-04-22 11:53 ` amonakov at gcc dot gnu.org
  2011-04-22 11:57 ` amonakov at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: amonakov at gcc dot gnu.org @ 2011-04-22 11:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Alexander Monakov <amonakov at gcc dot gnu.org> 2011-04-22 11:53:05 UTC ---
Author: amonakov
Date: Fri Apr 22 11:53:01 2011
New Revision: 172857

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=172857
Log:
    PR c/36750
    * c-typeck.c (pop_init_level): Do not warn about initializing
    with ` = {0}'.

testsuite:
    * gcc.dg/missing-field-init-2.c: Update testcase.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-typeck.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/missing-field-init-2.c


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

* [Bug c/36750] -Wmissing-field-initializers relaxation request
       [not found] <bug-36750-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2011-04-22 11:53 ` amonakov at gcc dot gnu.org
@ 2011-04-22 11:57 ` amonakov at gcc dot gnu.org
  2014-02-16 13:18 ` jackie.rosen at hushmail dot com
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: amonakov at gcc dot gnu.org @ 2011-04-22 11:57 UTC (permalink / raw)
  To: gcc-bugs

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

Alexander Monakov <amonakov at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |amonakov at gcc dot gnu.org
         Resolution|                            |FIXED

--- Comment #4 from Alexander Monakov <amonakov at gcc dot gnu.org> 2011-04-22 11:56:39 UTC ---
The above patch suppresses the warning in C regardless of whether the trailing
comma is present.  Closing as fixed.


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

* [Bug c/36750] -Wmissing-field-initializers relaxation request
       [not found] <bug-36750-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2011-04-22 11:57 ` amonakov at gcc dot gnu.org
@ 2014-02-16 13:18 ` jackie.rosen at hushmail dot com
  2014-04-14 14:43 ` amonakov at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: jackie.rosen at hushmail dot com @ 2014-02-16 13:18 UTC (permalink / raw)
  To: gcc-bugs

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

Jackie Rosen <jackie.rosen at hushmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jackie.rosen at hushmail dot com

--- Comment #5 from Jackie Rosen <jackie.rosen at hushmail dot com> ---
*** Bug 260998 has been marked as a duplicate of this bug. ***
Seen from the domain http://volichat.com
Page where seen: http://volichat.com/adult-chat-rooms
Marked for reference. Resolved as fixed @bugzilla.


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

* [Bug c/36750] -Wmissing-field-initializers relaxation request
       [not found] <bug-36750-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2014-02-16 13:18 ` jackie.rosen at hushmail dot com
@ 2014-04-14 14:43 ` amonakov at gcc dot gnu.org
  2014-04-15  5:54 ` nightstrike at gmail dot com
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: amonakov at gcc dot gnu.org @ 2014-04-14 14:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
Nightstrike, is there a particular reason you want C++ warning behavior be
adjusted?  Note that unlike C, in C++ you get zero-initialization by default,
so you don't need to write ' = {0};' to zero-initialize a structure in the
first place.  Thus I don't see if adjusting the warning is desirable for C++. 
I might be wrong; in that case I'd recommend you to open a new bug and
reference the new bug from here.


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

* [Bug c/36750] -Wmissing-field-initializers relaxation request
       [not found] <bug-36750-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2014-04-14 14:43 ` amonakov at gcc dot gnu.org
@ 2014-04-15  5:54 ` nightstrike at gmail dot com
  2014-04-15  6:37 ` amonakov at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: nightstrike at gmail dot com @ 2014-04-15  5:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from nightstrike <nightstrike at gmail dot com> ---
Are you sure C++ works like that?  I thought that member variables in a struct
would get default initialized to indeterminate values, as seen here:

http://en.cppreference.com/w/cpp/language/default_initialization

Surely, the C++ syntax of saying MyType x = {}; should be supported, as seen
here:

http://en.cppreference.com/w/cpp/language/aggregate_initialization

where for instance:

struct S {
    int a;
    float b;
    std::string str;
};

S s = {}; // identical to S s = {0, 0.0, std::string};

That shouldn't warn for the reasons stated in earlier comments.


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

* [Bug c/36750] -Wmissing-field-initializers relaxation request
       [not found] <bug-36750-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2014-04-15  5:54 ` nightstrike at gmail dot com
@ 2014-04-15  6:37 ` amonakov at gcc dot gnu.org
  2014-04-16  3:34 ` nightstrike at gmail dot com
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: amonakov at gcc dot gnu.org @ 2014-04-15  6:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
My statement about zero-initialization was inaccurate (thanks), but the general
point still stands: in C you have to write ' = {0}' since empty-braces
initializer is not supported by the language (you get a warning with
-pedantic); in C++, you can write ' = {}' or 'T foo = T();', but you don't need
to write ' = {0}' specifically.


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

* [Bug c/36750] -Wmissing-field-initializers relaxation request
       [not found] <bug-36750-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2014-04-15  6:37 ` amonakov at gcc dot gnu.org
@ 2014-04-16  3:34 ` nightstrike at gmail dot com
  2014-09-30 19:17 ` dcsommer at fb dot com
  2015-05-12  2:20 ` nightstrike at gmail dot com
  10 siblings, 0 replies; 11+ messages in thread
From: nightstrike at gmail dot com @ 2014-04-16  3:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from nightstrike <nightstrike at gmail dot com> ---
So should I open a new PR for not warning in C++?  Because even the "= {0}"
case warns there.


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

* [Bug c/36750] -Wmissing-field-initializers relaxation request
       [not found] <bug-36750-4@http.gcc.gnu.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2014-04-16  3:34 ` nightstrike at gmail dot com
@ 2014-09-30 19:17 ` dcsommer at fb dot com
  2015-05-12  2:20 ` nightstrike at gmail dot com
  10 siblings, 0 replies; 11+ messages in thread
From: dcsommer at fb dot com @ 2014-09-30 19:17 UTC (permalink / raw)
  To: gcc-bugs

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

Daniel Sommermann <dcsommer at fb dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dcsommer at fb dot com

--- Comment #11 from Daniel Sommermann <dcsommer at fb dot com> ---
Created attachment 33627
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33627&action=edit
Test case showing overly strict warning

This still produces false positives in C++11.

I attached a test case with several false positives. The compilation should be
clean as there are no uninitialized members. Repros with g++ 4.9.1

Compile with "g++ test.cpp -std=c++11 -Wmissing-field-initializers`"

Produces:

dcsommer@dcsommer-ThinkPad-T440s:~/src/proxygen-oss-test/proxygen$ g++ test.cpp
-Wmissing-field-initializers -std=c++11
test.cpp: In function ‘int main()’:
test.cpp:7:10: warning: missing initializer for member ‘Foo::bar’
[-Wmissing-field-initializers]
   Foo f1{};
          ^
test.cpp:7:10: warning: missing initializer for member ‘Foo::baz’
[-Wmissing-field-initializers]
test.cpp:8:11: warning: missing initializer for member ‘Foo::baz’
[-Wmissing-field-initializers]
   Foo f2{0};
           ^
test.cpp:9:14: warning: missing initializer for member ‘Foo::baz’
[-Wmissing-field-initializers]
   Foo f3 = {0};
              ^
test.cpp:10:15: warning: missing initializer for member ‘Foo::baz’
[-Wmissing-field-initializers]
   Foo f4 = {0,};
               ^
>From gcc-bugs-return-462970-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Sep 30 19:45:40 2014
Return-Path: <gcc-bugs-return-462970-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 30693 invoked by alias); 30 Sep 2014 19:45:38 -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 30258 invoked by uid 48); 30 Sep 2014 19:45:31 -0000
From: "Joost.VandeVondele at mat dot ethz.ch" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug sanitizer/63316] [5.0 Regression] False asan positive
Date: Tue, 30 Sep 2014 19:45:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: sanitizer
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: Joost.VandeVondele at mat dot ethz.ch
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution
Message-ID: <bug-63316-4-ytYCmRae74@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-63316-4@http.gcc.gnu.org/bugzilla/>
References: <bug-63316-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-09/txt/msg02804.txt.bz2
Content-length: 466

https://gcc.gnu.org/bugzilla/show_bug.cgi?idc316

Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> changed:

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

--- Comment #5 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> ---
fixed on trunk


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

* [Bug c/36750] -Wmissing-field-initializers relaxation request
       [not found] <bug-36750-4@http.gcc.gnu.org/bugzilla/>
                   ` (9 preceding siblings ...)
  2014-09-30 19:17 ` dcsommer at fb dot com
@ 2015-05-12  2:20 ` nightstrike at gmail dot com
  10 siblings, 0 replies; 11+ messages in thread
From: nightstrike at gmail dot com @ 2015-05-12  2:20 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 4962 bytes --]

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

--- Comment #12 from nightstrike <nightstrike at gmail dot com> ---
(In reply to Daniel Sommermann from comment #11)
> Created attachment 33627 [details]
> Test case showing overly strict warning
> 
> This still produces false positives in C++11.
> 
> I attached a test case with several false positives. The compilation should
> be clean as there are no uninitialized members. Repros with g++ 4.9.1
> 
> Compile with "g++ test.cpp -std=c++11 -Wmissing-field-initializers`"
> 
> Produces:
> 
> dcsommer@dcsommer-ThinkPad-T440s:~/src/proxygen-oss-test/proxygen$ g++
> test.cpp -Wmissing-field-initializers -std=c++11
> test.cpp: In function ‘int main()’:
> test.cpp:7:10: warning: missing initializer for member ‘Foo::bar’
> [-Wmissing-field-initializers]
>    Foo f1{};
>           ^
> test.cpp:7:10: warning: missing initializer for member ‘Foo::baz’
> [-Wmissing-field-initializers]
> test.cpp:8:11: warning: missing initializer for member ‘Foo::baz’
> [-Wmissing-field-initializers]
>    Foo f2{0};
>            ^
> test.cpp:9:14: warning: missing initializer for member ‘Foo::baz’
> [-Wmissing-field-initializers]
>    Foo f3 = {0};
>               ^
> test.cpp:10:15: warning: missing initializer for member ‘Foo::baz’
> [-Wmissing-field-initializers]
>    Foo f4 = {0,};
>                ^


This reproduces with 4.9.2 as well.  Request reopen.
>From gcc-bugs-return-486048-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue May 12 04:06:02 2015
Return-Path: <gcc-bugs-return-486048-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 107045 invoked by alias); 12 May 2015 04:06:02 -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 107014 invoked by uid 48); 12 May 2015 04:05:58 -0000
From: "chihin.ko at oracle dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/66116] New: no DW_TAG_template_type_parameter for template instantiation
Date: Tue, 12 May 2015 04:06:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.8.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: chihin.ko at oracle dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created
Message-ID: <bug-66116-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: 2015-05/txt/msg00888.txt.bz2
Content-length: 1640

https://gcc.gnu.org/bugzilla/show_bug.cgi?idf116

            Bug ID: 66116
           Summary: no DW_TAG_template_type_parameter for template
                    instantiation
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chihin.ko at oracle dot com
  Target Milestone: ---

Created attachment 35520
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id5520&actioníit
test case

For attached std_list_iterators.cc, there is no DW_TAG_template_type_parameter
for DW_TAG_class_type  "allocator<int>" :

< 2><0x00003bd7>      DW_TAG_class_type
                        DW_AT_name                  "allocator<int>"
                        DW_AT_byte_size             0x00000001
                        DW_AT_decl_file             0x00000006 allocator.h
                        DW_AT_decl_line             0x0000005c
                        DW_AT_sibling               <0x00003cbc>
< 3><0x00003be3>        DW_TAG_inheritance
                          DW_AT_type                  <0x000080f8>
                          DW_AT_data_member_location  DW_OP_plus_uconst 0
                          DW_AT_accessibility         DW_ACCESS_public
< 3><0x00003bec>        DW_TAG_typedef
                          DW_AT_name                  "reference"
                          DW_AT_decl_file             0x00000006 allocator.h
                          DW_AT_decl_line             0x00000063
                          DW_AT_type                  <0x00008ee9>
...
...


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

end of thread, other threads:[~2015-05-12  2:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-36750-4@http.gcc.gnu.org/bugzilla/>
2010-11-24 12:35 ` [Bug c/36750] -Wmissing-field-initializers relaxation request P at draigBrady dot com
2010-11-24 14:29 ` manu at gcc dot gnu.org
2011-04-22 11:53 ` amonakov at gcc dot gnu.org
2011-04-22 11:57 ` amonakov at gcc dot gnu.org
2014-02-16 13:18 ` jackie.rosen at hushmail dot com
2014-04-14 14:43 ` amonakov at gcc dot gnu.org
2014-04-15  5:54 ` nightstrike at gmail dot com
2014-04-15  6:37 ` amonakov at gcc dot gnu.org
2014-04-16  3:34 ` nightstrike at gmail dot com
2014-09-30 19:17 ` dcsommer at fb dot com
2015-05-12  2:20 ` nightstrike 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).