public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/65512] New: Inconsistent report of uninitialized members
@ 2015-03-22 13:49 development@faf-ltd.com
  2015-03-22 16:43 ` [Bug c++/65512] " redi at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: development@faf-ltd.com @ 2015-03-22 13:49 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 65512
           Summary: Inconsistent report of uninitialized members
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: blocker
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: development@faf-ltd.com

#include <atomic>

typedef struct
{
    char            sDateTime [20];
    std::atomic<bool>    bReadyToFlush;
} LogEntries;

typedef struct
{
    LogEntries        leLogEntries [1] {};
} LogThreads;

Compiling with g++ -std=c++11 gcc-warning-bug.cpp -Wall -Wextra -Werror
-fno-strict-aliasing -fwrapv -fno-aggressive-loop-optimizations -c

Compiler error:
gcc-warning-bug.cpp:11:34: error: missing initializer for member
‘LogEntries::sDateTime’ [-Werror=missing-field-initializers]
  LogEntries    leLogEntries [1] {};
                                  ^
gcc-warning-bug.cpp:11:34: error: missing initializer for member
‘LogEntries::bReadyToFlush’ [-Werror=missing-field-initializers]
cc1plus: all warnings being treated as error


I consider it as a bug because one of these following steps does not produce
the error message:
1) comment the line     std::atomic<bool>    bReadyToFlush;
2) Add {} to     char sDateTime [20];
>From gcc-bugs-return-481108-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Mar 22 12:46:55 2015
Return-Path: <gcc-bugs-return-481108-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 14704 invoked by alias); 22 Mar 2015 12:46:54 -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 14661 invoked by uid 48); 22 Mar 2015 12:46:50 -0000
From: "development@faf-ltd.com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/65512] Inconsistent report of uninitialized members
Date: Sun, 22 Mar 2015 14:25: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.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: blocker
X-Bugzilla-Who: development@faf-ltd.com
X-Bugzilla-Status: UNCONFIRMED
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:
Message-ID: <bug-65512-4-gOhjlb36l9@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65512-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65512-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-03/txt/msg02252.txt.bz2
Content-length: 2495

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

--- Comment #1 from Peter VARGA <development@faf-ltd.com> ---
Output for the -v option:

Using built-in specs.
COLLECT_GCC=g++
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.9.2_source/configure --disable-multilib
Thread model: posix
gcc version 4.9.2 (GCC)
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++11' '-Wall' '-Wextra' '-c'
'-Werror' '-fno-strict-aliasing' '-fwrapv' '-fno-aggressive-loop-optimizations'
'-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.9.2/cc1plus -E -quiet -v
-D_GNU_SOURCE gcc-warning-bug.cpp -mtune=generic -march=x86-64 -std=c++11 -Wall
-Wextra -Werror -fno-strict-aliasing -fwrapv -fno-aggressive-loop-optimizations
-fpch-preprocess -o gcc-warning-bug.ii
ignoring nonexistent directory
"/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.9.2/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:

/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.9.2/../../../../include/c++/4.9.2

/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.9.2/../../../../include/c++/4.9.2/x86_64-unknown-linux-gnu

/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.9.2/../../../../include/c++/4.9.2/backward
 /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.9.2/include
 /usr/local/include
 /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.9.2/include-fixed
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++11' '-Wall' '-Wextra' '-c'
'-Werror' '-fno-strict-aliasing' '-fwrapv' '-fno-aggressive-loop-optimizations'
'-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.9.2/cc1plus -fpreprocessed
gcc-warning-bug.ii -quiet -dumpbase gcc-warning-bug.cpp -mtune=generic
-march=x86-64 -auxbase gcc-warning-bug -Wall -Wextra -Werror -std=c++11
-version -fno-strict-aliasing -fwrapv -fno-aggressive-loop-optimizations -o
gcc-warning-bug.s
GNU C++ (GCC) version 4.9.2 (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.9.2, GMP version 4.2.3, MPFR version 3.1.2,
MPC version 0.8.2
GGC heuristics: --param ggc-min-expand\x100 --param ggc-min-heapsize\x131072
GNU C++ (GCC) version 4.9.2 (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.9.2, GMP version 4.2.3, MPFR version 3.1.2,
MPC version 0.8.2
GGC heuristics: --param ggc-min-expand\x100 --param ggc-min-heapsize\x131072
Compiler executable checksum: 660c5687a086ea3686f43ea5e642dd2c


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

* [Bug c++/65512] Inconsistent report of uninitialized members
  2015-03-22 13:49 [Bug c++/65512] New: Inconsistent report of uninitialized members development@faf-ltd.com
@ 2015-03-22 16:43 ` redi at gcc dot gnu.org
  2015-03-22 16:45 ` development@faf-ltd.com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2015-03-22 16:43 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|blocker                     |normal

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This is clearly not severity=blocker. That would mean it should block a
release, which is nonsense as it is already present in existing releases. Just
don't use -Werror if you don't want the error.

There's no warning with 5.0 anyway.


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

* [Bug c++/65512] Inconsistent report of uninitialized members
  2015-03-22 13:49 [Bug c++/65512] New: Inconsistent report of uninitialized members development@faf-ltd.com
  2015-03-22 16:43 ` [Bug c++/65512] " redi at gcc dot gnu.org
@ 2015-03-22 16:45 ` development@faf-ltd.com
  2015-03-22 16:52 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: development@faf-ltd.com @ 2015-03-22 16:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Peter VARGA <development@faf-ltd.com> ---
1) I had no idea how the importance is qualified. Is my 1st bug report. For me
it was a blocker because I could not finish compiling
2) Not using -Werror is really a bit hard - don't you think?! My workaround is
using the -Wno-missing-field-initializers switch
3) What about 4.9.3 - I cannot use 5.0 once released.


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

* [Bug c++/65512] Inconsistent report of uninitialized members
  2015-03-22 13:49 [Bug c++/65512] New: Inconsistent report of uninitialized members development@faf-ltd.com
  2015-03-22 16:43 ` [Bug c++/65512] " redi at gcc dot gnu.org
  2015-03-22 16:45 ` development@faf-ltd.com
@ 2015-03-22 16:52 ` redi at gcc dot gnu.org
  2015-03-22 16:59 ` development@faf-ltd.com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2015-03-22 16:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Peter VARGA from comment #3)
> 1) I had no idea how the importance is qualified. Is my 1st bug report. For
> me it was a blocker because I could not finish compiling

That applies to most bugs if you think about it. And every bug reporter thinks
their bug is important ... to them.

> 2) Not using -Werror is really a bit hard - don't you think?!

Umm, no.


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

* [Bug c++/65512] Inconsistent report of uninitialized members
  2015-03-22 13:49 [Bug c++/65512] New: Inconsistent report of uninitialized members development@faf-ltd.com
                   ` (2 preceding siblings ...)
  2015-03-22 16:52 ` redi at gcc dot gnu.org
@ 2015-03-22 16:59 ` development@faf-ltd.com
  2015-03-24 10:18 ` paolo.carlini at oracle dot com
  2015-03-24 10:25 ` development@faf-ltd.com
  5 siblings, 0 replies; 7+ messages in thread
From: development@faf-ltd.com @ 2015-03-22 16:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Peter VARGA <development@faf-ltd.com> ---
1) There are bugs which are not important. It is always a point of view. As a
starter here I had 2 possibilities and I took the wrong. More or less you may
be right but it was a simple misunderstanding. AND I did NOT think the bug is
important because I have already a solution. It was blocker for me because
compiler could not finish.

2) :-) - I am used my sources do compile on a very high restrict level. 

3) What about 4.9.3 - is it fixed or not?


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

* [Bug c++/65512] Inconsistent report of uninitialized members
  2015-03-22 13:49 [Bug c++/65512] New: Inconsistent report of uninitialized members development@faf-ltd.com
                   ` (3 preceding siblings ...)
  2015-03-22 16:59 ` development@faf-ltd.com
@ 2015-03-24 10:18 ` paolo.carlini at oracle dot com
  2015-03-24 10:25 ` development@faf-ltd.com
  5 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-03-24 10:18 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |5.0

--- Comment #6 from Paolo Carlini <paolo.carlini at oracle dot com> ---
This is fixed in 5.0 indeed.


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

* [Bug c++/65512] Inconsistent report of uninitialized members
  2015-03-22 13:49 [Bug c++/65512] New: Inconsistent report of uninitialized members development@faf-ltd.com
                   ` (4 preceding siblings ...)
  2015-03-24 10:18 ` paolo.carlini at oracle dot com
@ 2015-03-24 10:25 ` development@faf-ltd.com
  5 siblings, 0 replies; 7+ messages in thread
From: development@faf-ltd.com @ 2015-03-24 10:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Peter VARGA <development@faf-ltd.com> ---
Due the fact some frameworks do NOT support gcc 5.0 yet I would like to know if
this bug is going to be fixed in a 4.9.X version or not.


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

end of thread, other threads:[~2015-03-24 10:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-22 13:49 [Bug c++/65512] New: Inconsistent report of uninitialized members development@faf-ltd.com
2015-03-22 16:43 ` [Bug c++/65512] " redi at gcc dot gnu.org
2015-03-22 16:45 ` development@faf-ltd.com
2015-03-22 16:52 ` redi at gcc dot gnu.org
2015-03-22 16:59 ` development@faf-ltd.com
2015-03-24 10:18 ` paolo.carlini at oracle dot com
2015-03-24 10:25 ` development@faf-ltd.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).