public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/25137]  New: Warning "missing braces around initializer" causing problems with tr1::array
@ 2005-11-28 14:30 chris at bubblescope dot net
  2005-11-28 14:52 ` [Bug c++/25137] " pinskia at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 26+ messages in thread
From: chris at bubblescope dot net @ 2005-11-28 14:30 UTC (permalink / raw)
  To: gcc-bugs

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


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

end of thread, other threads:[~2012-05-29  9:42 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-25137-4@http.gcc.gnu.org/bugzilla/>
2010-12-17 11:21 ` [Bug c++/25137] Warning "missing braces around initializer" causing problems with tr1::array bitti at iki dot fi
2010-12-17 11:27 ` paolo.carlini at oracle dot com
2010-12-17 11:34 ` redi at gcc dot gnu.org
2010-12-17 12:23 ` paolo.carlini at oracle dot com
2011-08-27  9:23 ` baffo32 at gmail dot com
2011-08-30 10:29 ` paolo.carlini at oracle dot com
2012-05-26 21:24 ` jason at gcc dot gnu.org
2012-05-26 22:38 ` paolo.carlini at oracle dot com
2012-05-28 17:46 ` paolo.carlini at oracle dot com
2012-05-28 17:46 ` paolo at gcc dot gnu.org
2012-05-28 18:35 ` paolo at gcc dot gnu.org
2012-05-29  8:09 ` manu at gcc dot gnu.org
2012-05-29  9:27 ` paolo.carlini at oracle dot com
2012-05-29  9:28 ` manu at gcc dot gnu.org
2012-05-29  9:43 ` paolo.carlini at oracle dot com
2005-11-28 14:30 [Bug c++/25137] New: " chris at bubblescope dot net
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

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