gcc and pointer-to-arrays

Discussion in 'C' started by Alex, Apr 12, 2009.

  1. Alex

    Alex New Member

    Joined:
    Oct 1, 2006
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    0
    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
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice