<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello,<div><br></div><div>There is currently this comment in SemaDeclAttr.cpp concerning the 'cleanup' attribute argument type checking:</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(0, 116, 0); "><span style="color: #000000">  </span>// We're currently more strict than GCC about what function types we accept.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(0, 116, 0); "><span style="color: #000000">  </span>// If this ever proves to be a problem it should be easy to fix.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(38, 71, 75); "><span style="color: #000000">  </span><span style="color: #3f6e74">QualType</span><span style="color: #000000"> </span><span style="color: #5c2699">Ty</span><span style="color: #000000"> = </span><span style="color: #3f6e74">S</span><span style="color: #000000">.</span><span style="color: #3f6e74">Context</span><span style="color: #000000">.</span>getPointerType<span style="color: #000000">(</span><span style="color: #3f6e74">VD</span><span style="color: #000000">-></span>getType<span style="color: #000000">());</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">  <span style="color: #3f6e74">QualType</span> ParamTy = <span style="color: #3f6e74">FD</span>-><span style="color: #26474b">getParamDecl</span>(<span style="color: #1c00cf">0</span>)-><span style="color: #26474b">getType</span>();</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">  <span style="color: #aa0d91">if</span> (<span style="color: #5c2699">Ty</span> != ParamTy) {</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">    <span style="color: #3f6e74">S</span>.<span style="color: #26474b">Diag</span>(<span style="color: #3f6e74">Attr</span>.<span style="color: #26474b">getLoc</span>(), </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">           diag::err_attribute_cleanup_func_arg_incompatible_type) <<</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">      <span style="color: #3f6e74">Attr</span>.<span style="color: #26474b">getParameterName</span>() << ParamTy << <span style="color: #5c2699">Ty</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(170, 13, 145); "><span style="color: #000000">    </span>return<span style="color: #000000">;</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">  }</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px; ">It is a problem with objc as declaring a cleanup fonction that take an (id *) will force all variables that use this function to be strictly typed as  'id'.  (see bug #<span class="Apple-style-span" style="font-family: -webkit-sans-serif; font-size: 16px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><a href="http://llvm.org/bugs/show_bug.cgi?id=3656" style="color: rgb(51, 51, 51); font-size: 13px; ">3656</a>)</span></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px;"><br></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px; white-space: pre; ">error: 'cleanup' function '$wb_scopeReleaseObject' parameter has type 'id *', expected type 'NSString **'</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px; white-space: pre;"><br></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px; white-space: pre; "><span class="Apple-style-span" style="white-space: normal; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; ">What could be done to workaround this issue ? It prevent compilation of file that gcc compile fine, and it prevent me to test clang with some objc projects :-(</span></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px;"><br></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="font-size: 12px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px;"><br></span></font></div></div></body></html>