This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Need suggestion about bug 68425
- From: Prasad Ghangal <prasad dot ghangal at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 18 Feb 2016 17:10:53 +0530
- Subject: Need suggestion about bug 68425
- Authentication-results: sourceware.org; auth=none
I was looking at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68425
For testcase
const int array[2] = { 1, 2, 3 ,6 ,89 ,193};
gcc 6.0.0 produces warnings like (spacing may get disturbed by gmail) :
68425.c: In function âmainâ:
68425.c:3:34: warning: excess elements in array initializer
const int array[2] = { 1, 2, 3 ,6 ,89 ,193};
^
68425.c:3:34: note: (near initialization for âarrayâ)
68425.c:3:37: warning: excess elements in array initializer
const int array[2] = { 1, 2, 3 ,6 ,89 ,193};
^
68425.c:3:37: note: (near initialization for âarrayâ)
68425.c:3:40: warning: excess elements in array initializer
const int array[2] = { 1, 2, 3 ,6 ,89 ,193};
^~
68425.c:3:40: note: (near initialization for âarrayâ)
68425.c:3:44: warning: excess elements in array initializer
const int array[2] = { 1, 2, 3 ,6 ,89 ,193};
^~~
68425.c:3:44: note: (near initialization for âarrayâ)
While clang gives :
68425.c:3:34: warning: excess elements in array initializer
const int array[2] = { 1, 2, 3 ,6 ,89 ,193};
^
1 warning generated.
Wouldn't it be nice instead of multiple warnings if gcc gives single
warning like :
68425.c:3:34: warning: excess elements in array initializer (6
elements, expected 2)
const int array[2] = { 1, 2, 3 ,6 ,89 ,193};
^
--
Thanks and Regards,
Prasad Ghangal