Need suggestion about bug 68425
Prasad Ghangal
prasad.ghangal@gmail.com
Wed Feb 24 12:26:00 GMT 2016
Thanks Prathamesh and Joseph for your suggestions.
Here is my updated patch :
for test cases:
const int array[5] = {1, 2, 3};
const int array1[3] = {1, 2, 3, 6};
const int array2[4] = {1, 2, 3, 6, 89};
const int array3[5] = {1, 2, 3, 6, 89, 193};
const int array4[3] = {1, 2, 3, 6, 89, 193};
const int array5[1] = {1, 2, 3, 6, 89, 193};
const int array6[3] = {1, 2, 3, 6, 89, 193;
const int array7[5] = {1, 2, 3, 6, 89, 193}
const int array8[5] = {1, 2, 3, 6, 89, 193
It gives:
68425.c: In function ‘main’:
68425.c:4:37: warning: excess elements in array initializer (4
elements, expected 3)
const int array1[3] = {1, 2, 3, 6};
^
68425.c:4:37: note: (near initialization for ‘array1’)
68425.c:5:40: warning: excess elements in array initializer (5
elements, expected 4)
const int array2[4] = {1, 2, 3, 6, 89};
^~
68425.c:5:40: note: (near initialization for ‘array2’)
68425.c:6:44: warning: excess elements in array initializer (6
elements, expected 5)
const int array3[5] = {1, 2, 3, 6, 89, 193};
^~~
68425.c:6:44: note: (near initialization for ‘array3’)
68425.c:7:37: warning: excess elements in array initializer (6
elements, expected 3)
const int array4[3] = {1, 2, 3, 6, 89, 193};
^
68425.c:7:37: note: (near initialization for ‘array4’)
68425.c:8:31: warning: excess elements in array initializer (6
elements, expected 1)
const int array5[1] = {1, 2, 3, 6, 89, 193};
^
68425.c:8:31: note: (near initialization for ‘array5’)
68425.c:9:37: warning: excess elements in array initializer (6
elements, expected 3)
const int array6[3] = {1, 2, 3, 6, 89, 193;
^
68425.c:9:37: note: (near initialization for ‘array6’)
68425.c:9:47: error: expected ‘}’ before ‘;’ token
const int array6[3] = {1, 2, 3, 6, 89, 193;
^
68425.c:14:1: error: expected declaration or statement at end of input
}
^
Any suggestions?
--
Thanks and Regards,
Prasad Ghangal
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PR68425.patch
Type: text/x-patch
Size: 7521 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20160224/bfc6646c/attachment.bin>
More information about the Gcc
mailing list