public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "chris at bubblescope dot net" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/25137] New: Warning "missing braces around initializer" causing problems with tr1::array Date: Mon, 28 Nov 2005 14:30:00 -0000 [thread overview] Message-ID: <bug-25137-9525@http.gcc.gnu.org/bugzilla/> (raw) The following code: struct S { int x[3]; }; void f() { S s = {1,2,3};} With -Wmissing-braces (which is implied by -Wall, among others) gives: warning: missing braces around initializer for 'int [3]' In the specific case where a struct contains only a single array, adding the extra braces doesn't really seem that useful. The reason it would be nice to fix this that in the definition of tr1::array in the TR1 specification (page 88, 6.2.2) says 2.An array is an aggregate ([dcl.init.aggr]) that can be initialized with the syntax array a = { initializer-list }; where initializer-list is a comma separated list of up to N elements whose types are convertible to T. -- Summary: Warning "missing braces around initializer" causing problems with tr1::array Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: chris at bubblescope dot net http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25137
next reply other threads:[~2005-11-28 14:30 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2005-11-28 14:30 chris at bubblescope dot net [this message] 2005-11-28 14:52 ` [Bug c++/25137] " pinskia at gcc dot gnu dot org 2005-11-28 15:17 ` chris at bubblescope dot net 2005-11-28 16:15 ` gdr at integrable-solutions dot net 2005-11-28 16:18 ` gdr at integrable-solutions dot net 2005-11-28 16:28 ` chris at bubblescope dot net 2005-11-28 16:33 ` chris at bubblescope dot net 2005-11-28 18:46 ` gdr at integrable-solutions dot net 2005-12-04 5:04 ` gdr at gcc dot gnu dot org 2005-12-06 13:07 ` gcc-bugzilla at kayari dot org 2006-04-04 5:44 ` pinskia at gcc dot gnu dot org 2007-09-21 16:50 ` pcarlini at suse dot de
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-25137-9525@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: linkBe 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).