On 8 Sep 2005 13:25:53 -0700, "steve" <SteveKlett@gmail.com> wrote in
comp.arch.embedded:
> The following compiles fine in Visual Studio and is something that I do
> often:
> <code>
> int a = 0;
> int b = 0;
>
> int* ptrs[2];
> ptrs[0] = &a;
> ptrs[1] = &b;
> </code>
>
> This same code complains that "the size of an array must be greater
> than zero" in IAR.
>
> Anyone know what I should do? Is there a switch somewhere that I need
> to flip in the options?
>
> Is this "bad" code, seems fine and legal to me.
>
> Hope someone can help,
> Steve
confused!
It also complains with the same error about this code:
<code>
int tmp[10];
tmp[0] = 1;
</code>
seems like a bug or something to me :(
Reply by steve●September 8, 20052005-09-08
The following compiles fine in Visual Studio and is something that I do
often:
<code>
int a = 0;
int b = 0;
int* ptrs[2];
ptrs[0] = &a;
ptrs[1] = &b;
</code>
This same code complains that "the size of an array must be greater
than zero" in IAR.
Anyone know what I should do? Is there a switch somewhere that I need
to flip in the options?
Is this "bad" code, seems fine and legal to me.
Hope someone can help,
Steve