<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Aug 14, 2009, at 2:53 PM, Ted Kremenek wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><br>On Aug 14, 2009, at 2:51 PM, Eli Friedman wrote:<br><br><blockquote type="cite">On Fri, Aug 14, 2009 at 1:51 PM, Ted Kremenek<<a href="mailto:kremenek@apple.com">kremenek@apple.com</a>>  <br></blockquote><blockquote type="cite">wrote:<br></blockquote><blockquote type="cite"><blockquote type="cite">--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Fri Aug 14 15:51:58 2009<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">@@ -438,13 +438,14 @@<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">   return;<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> }<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">-  if (!isFunction(d)) {<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">+  const FunctionDecl *FD = dyn_cast<FunctionDecl>(d);<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">+<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">+  if (!FD) {<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">   S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type)<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">     << Attr.getName() << 0 /*function*/;<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">   return;<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> }<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Unless I'm mistaken, this breaks constructs like the following:<br></blockquote><blockquote type="cite">__attribute((malloc)) void *(*f)();<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">-Eli<br></blockquote><br>Thanks for pointing this out.  I'll fix it.</span></blockquote></div><br><div>Incidentally, the previous code didn't explicitly handle that case either.  The return type of the function pointer wouldn't actually be checked to see if it was a pointer.</div></body></html>