M
mjkrol
Crossposting from comp.lang.c.moderated.
On gcc 4.2.4 with `-O3' I am getting a warning for the following code.
void foo(const float rgba[][4])
{
}
void bar(float rgba[][4])
{
foo((const float (*)[4]) rgba);
}
int main (void)
{
float color[3][4];
foo(color);
return 0;
}
$ gcc -O3 foobar.c
foobar.c:7: warning: passing argument 1 of "foo" from incompatible
pointer type
Why turning optimisations on would generate this kind of warning? Is
this a bug in gcc?
Thanks.
On gcc 4.2.4 with `-O3' I am getting a warning for the following code.
void foo(const float rgba[][4])
{
}
void bar(float rgba[][4])
{
foo((const float (*)[4]) rgba);
}
int main (void)
{
float color[3][4];
foo(color);
return 0;
}
$ gcc -O3 foobar.c
foobar.c:7: warning: passing argument 1 of "foo" from incompatible
pointer type
Why turning optimisations on would generate this kind of warning? Is
this a bug in gcc?
Thanks.