[cfe-dev] Comparison of pointers between Objc subclasses

Eli Friedman eli.friedman at gmail.com
Tue Jul 1 19:44:56 PDT 2008


On Tue, Jul 1, 2008 at 4:22 PM, Ted Kremenek <kremenek at apple.com> wrote:
> Are pointer type compatibility checks for assignments and conversions being
> handled in the same way?

Assignment (from C99 6.5.16.1):
One of the following shall hold:
<snip>
both operands are pointers to qualified or unqualified versions of
compatible types, and the type pointed to by the left has all the
qualifiers of the type pointed to by the right;
<snip>

Comparison (from C99 6.5.9):
One of the following shall hold:
<snip>
both operands are pointers to qualified or unqualified versions of
compatible types;
<snip>

And currently, we (inconsistently) consider ObjC base types and
derived types compatible in the C99 sense, which is implemented in
ASTContext::typesAreCompatible.

-Eli



More information about the cfe-dev mailing list