This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/70924] Wrong position for "warning: missing braces around initializer [-Wmissing-braces]"
- From: "su at cs dot ucdavis.edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 27 Jun 2016 01:54:05 +0000
- Subject: [Bug c/70924] Wrong position for "warning: missing braces around initializer [-Wmissing-braces]"
- Auto-submitted: auto-generated
- References: <bug-70924-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70924
Zhendong Su <su at cs dot ucdavis.edu> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |su at cs dot ucdavis.edu
--- Comment #1 from Zhendong Su <su at cs dot ucdavis.edu> ---
Here is another test pinpointing the same issue:
$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/usr/local/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 7.0.0 20160626 (experimental) [trunk revision 237789] (GCC)
$
$ gcc-trunk -c -Wmissing-braces check.c
check.c:1:15: warning: missing braces around initializer [-Wmissing-braces]
int a[3][1] = { { 0 }, { 1 }, 2 };
^
check.c:1:15: note: (near initialization for âaâ)
$
$ clang -c -Wmissing-braces check.c
check.c:1:31: warning: suggest braces around initialization of subobject
[-Wmissing-braces]
int a[3][1] = { { 0 }, { 1 }, 2 };
^
{}
1 warning generated.
$
$ cat check.c
int a[3][1] = { { 0 }, { 1 }, 2 };