This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/36432] New: “incompatible pointer type” with pointer to array as a struct member
- From: "anders at kaseorg dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Jun 2008 02:56:27 -0000
- Subject: [Bug c/36432] New: “incompatible pointer type” with pointer to array as a struct member
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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