This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/20175] [3.4 Regression] Warnings are issued when initializing struct members with "strings"
- From: "gcc at magfr dot user dot lysator dot liu dot se" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Feb 2005 14:55:58 -0000
- Subject: [Bug c++/20175] [3.4 Regression] Warnings are issued when initializing struct members with "strings"
- References: <20050223181311.20175.gcc@magfr.user.lysator.liu.se>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From gcc at magfr dot user dot lysator dot liu dot se 2005-02-25 14:55 -------
(In reply to comment #3)
> Patch here: <http://gcc.gnu.org/ml/gcc-patches/2005-02/msg01489.html>
This fixes the obvious case but it also makes the following pass with no
warnings and that is wrong, note especially S1 and S3!
struct S { char a[6]; int b[2]; };
S S0 = { { "hello" }, { 1, 2 } };
S S1 = { { "hello" }, 1, 2 }; // Highly suspicious
S S2 = { "hello", { 1, 2 } };
S S3 = { "hello", 1, 2 }; // Highly suspicious
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20175