public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "development@faf-ltd.com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/65512] New: Inconsistent report of uninitialized members
Date: Sun, 22 Mar 2015 13:49:00 -0000	[thread overview]
Message-ID: <bug-65512-4@http.gcc.gnu.org/bugzilla/> (raw)

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


             reply	other threads:[~2015-03-22 12:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-22 13:49 development@faf-ltd.com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-65512-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).