{"id":45,"date":"2012-06-26T12:43:25","date_gmt":"2012-06-26T16:43:25","guid":{"rendered":"http:\/\/blog.blackgecko.com\/?p=45"},"modified":"2012-06-26T12:45:35","modified_gmt":"2012-06-26T16:45:35","slug":"telling-clang-to-be-quiet","status":"publish","type":"post","link":"http:\/\/blog.blackgecko.com\/?p=45","title":{"rendered":"Telling clang to be quiet"},"content":{"rendered":"<p>When using Xcode I&#8217;m a big believer in clearing out not just the error messages that I get but also all the warnings. 99% of the time if I ignore a warning it usually results in something crashing or a weird bug expressing itself. <strong>BUT\u00a0<\/strong>there is that 1% of the time when Xcode produces a false positive and you get a warning that isn&#8217;t and all you want to do is make it go away. Today was such a day and thankfully I found how to tell clang to ignore the warning.<\/p>\n<p>I have some code:<\/p>\n<pre class=\"brush: objc; title: ; notranslate\" title=\"\">\r\n[component performSelector:componentSelector];\r\n<\/pre>\n<p>clang really doesn&#8217;t like this code. The problem is that &#8216;componentSelector&#8217; is a variable and clang doesn&#8217;t have a enough information about it so it raises a flag about possible memory leak. Now, I know, since I wrote the code, that &#8216;componentSelector&#8217; is good and won&#8217;t cause a memory leak so to silence the warning I add the following:<\/p>\n<pre class=\"brush: objc; title: ; notranslate\" title=\"\">\r\n#pragma clang diagnostic ignored &quot;-Warc-performSelector-leaks&quot;\r\n[component performSelector:componentSelector];\r\n<\/pre>\n<p>this is a very nicely specific flag telling clang to ignore the performSelector leaks warning. I&#8217;d really rather find away around this, ie making clang happy, but thus far no luck so it&#8217;s the ignore flag till I do.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When using Xcode I&#8217;m a big believer in clearing out not just the error messages that I get but also all the warnings. 99% of the time if I ignore a warning it usually results in something crashing or a &hellip; <a href=\"http:\/\/blog.blackgecko.com\/?p=45\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,6,8,1],"tags":[],"class_list":["post-45","post","type-post","status-publish","format-standard","hentry","category-clang","category-objective-c","category-programming","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/blog.blackgecko.com\/index.php?rest_route=\/wp\/v2\/posts\/45","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.blackgecko.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.blackgecko.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.blackgecko.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.blackgecko.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=45"}],"version-history":[{"count":6,"href":"http:\/\/blog.blackgecko.com\/index.php?rest_route=\/wp\/v2\/posts\/45\/revisions"}],"predecessor-version":[{"id":60,"href":"http:\/\/blog.blackgecko.com\/index.php?rest_route=\/wp\/v2\/posts\/45\/revisions\/60"}],"wp:attachment":[{"href":"http:\/\/blog.blackgecko.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=45"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.blackgecko.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=45"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.blackgecko.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=45"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}