[Bug c/70924] Wrong position for "warning: missing braces around initializer [-Wmissing-braces]"
su at cs dot ucdavis.edu
gcc-bugzilla@gcc.gnu.org
Mon Jun 27 01:54:00 GMT 2016
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 };
More information about the Gcc-bugs
mailing list