Skip to content

Commit f30a251

Browse files
author
Daniel Kroening
committed
ignore size of arrays on ptr-to-array conversions
1 parent 8befd02 commit f30a251

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/ansi-c/c_typecast.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,13 @@ void c_typecastt::implicit_typecast_followed(
543543
// Also generous: between any to scalar types it's ok.
544544
// We should probably check the size.
545545
}
546+
else if(src_sub.id()==ID_array &&
547+
dest_sub.id()==ID_array &&
548+
base_type_eq(src_sub.subtype(), dest_sub.subtype(), ns))
549+
{
550+
// we ignore the size of the top-level array
551+
// in the case of pointers to arrays
552+
}
546553
else
547554
warnings.push_back("incompatible pointer types");
548555

0 commit comments

Comments
 (0)