This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/36432] New: “incompatible pointer type” with pointer to array as a struct member


According to gcc warnings, a pointer to int[] can be assigned the address of an
int[3], but not if the variable is a struct member:

int main() {
    int array[3];
    int (*ptr)[];
    struct { int (*ptr)[]; } st;

    ptr = &array;     // fine
    st.ptr = &array;  // warning: assignment from incompatible pointer type
}


-- 
           Summary: ?incompatible pointer type? with pointer to array as a
                    struct member
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: anders at kaseorg dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36432


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]