This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/20175] [3.4 Regression] Warnings are issued when initializing struct members with "strings"


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]