<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>The simplest way to do this is Expr::getType. The type of the CastExpr is the casted type, the type of the CastExpr's subexpression is the original type.</div><div><br></div><div>If you want to get more information here, look into ExplicitCastExpr::getTypeInfoAsWritten.</div><div><br></div><div>Hope that helps,</div><div>Jordan</div><div><br></div><br><div><div>On Sep 9, 2013, at 6:38 , Arthur Yoo <<a href="mailto:phjy007@gmail.com">phjy007@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Hi all, <div><br></div><div>I want to get the types' information in my checker. The method interface I am using is checkPostStmt(const CStyleCastExpr *cec, CheckerContext &C) const;</div><div><br></div>
<div>For example, there is a statement:</div><div>int *pi;</div><div>char *pc;</div><div>int a = 3;</div><div>pi = &a;</div><div>pc = (char *)pi;</div><div><br></div><div>After analysing "<i>(char *)pi;</i>", I want to get the type-related information, that is, the original type is <i>int*</i>, the casted type is <i>char *</i>. So how can I get that target? Thanks a lot.</div>
<div><div><br></div>-- <br><div dir="ltr"><font color="#444444">Best regards,</font><div><font color="#444444">Arthur Yoo</font></div></div>
</div></div>
_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev<br></blockquote></div><br></body></html>