This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25137] Warning "missing braces around initializer" causing problems with tr1::array
- From: "gdr at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Dec 2005 05:04:37 -0000
- Subject: [Bug c++/25137] Warning "missing braces around initializer" causing problems with tr1::array
- References: <bug-25137-9525@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #8 from gdr at gcc dot gnu dot org 2005-12-04 05:04 -------
(In reply to comment #0)
> 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
After more thoughts on this issue, it appears to me that it is asking for
a special casing justforo tr1::array<> to work. I don't know whether
that is a workable approach. I would reommend -Wno-missing-braces in this
specific case. Thoughts?
--
gdr at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |gdr at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25137