On 3 April 2016 at 16:56, Prasad Ghangal wrote:
>
> Also for
>
> int array[10];
> array[100]=10;
>
> Currently, GCC doesn't emit any warning (even with -Wall option)
>
> Wouldn't it be nice if GCC gives some warning like Clang, which gives:
>
> foo.c:4:3: warning: array index 100 is past the end o
On 5 March 2016 at 01:06, David Malcolm wrote:
> On Wed, 2016-02-24 at 17:56 +0530, Prasad Ghangal wrote:
>> 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}
On 4 March 2016 at 19:36, David Malcolm wrote:
> Those caret locations look wrong to me - they don't seem to be
> underlining the pertinent source. Is that what the patched compiler is
> printing, or did things get messed up somewhere via email?
Probably Gmail sucks at sending plain text. It suc
On Wed, 2016-02-24 at 17:56 +0530, Prasad Ghangal wrote:
> 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};
> c
PING
I would like to know if there is other better way of doing this.
On 24 February 2016 at 17:56, Prasad Ghangal wrote:
> 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
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,
On Sun, 21 Feb 2016, Prasad Ghangal wrote:
> - pedwarn_init (loc, 0,
> -"excess elements in array initializer");
> + pedwarn_init (loc, 0, "excess elements in array initializer "
> + "(%lu elements, expected %lu)",
> + tree_to_uhwi (const
On 21 February 2016 at 12:32, Prasad Ghangal wrote:
> I was working on PR68425,
>
> my untested patch :
>
>
> diff --git a/trunk/gcc/c/c-typeck.c b/trunk/gcc/c/c-typeck.c
> --- a/trunk/gcc/c/c-typeck.c(revision 232768)
> +++ b/trunk/gcc/c/c-typeck.c(working copy)
> @@ -5856,7 +5856,7 @@
>
I was working on PR68425,
my untested patch :
diff --git a/trunk/gcc/c/c-typeck.c b/trunk/gcc/c/c-typeck.c
--- a/trunk/gcc/c/c-typeck.c(revision 232768)
+++ b/trunk/gcc/c/c-typeck.c(working copy)
@@ -5856,7 +5856,7 @@
component name is taken from the spelling stack. */
static void
On 19 February 2016 at 19:13, David Malcolm wrote:
>> 68425.c:3:34: warning: excess elements in array initializer (6
>> elements,
>> expected 2)
>>const int array[2] = { 1, 2, 3 ,6 ,89 ,193};
>> ^
>
> Yes, that would be ideal. Unfortunately,
On Thu, 2016-02-18 at 14:28 +, Manuel López-Ibáñez wrote:
> On 18/02/16 11:40, Prasad Ghangal wrote:
> > 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)
On 18/02/16 11:40, Prasad Ghangal wrote:
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};
12 matches
Mail list logo