{"id":1212,"date":"2012-04-04T08:39:22","date_gmt":"2012-04-04T13:39:22","guid":{"rendered":"http:\/\/www.jaimerios.com\/?p=1212"},"modified":"2012-04-04T08:39:22","modified_gmt":"2012-04-04T13:39:22","slug":"selectively-disable-warnings-with-clang","status":"publish","type":"post","link":"https:\/\/jaimerios.com\/?p=1212","title":{"rendered":"&#8220;Selectively Disable Warnings&#8221; with clang"},"content":{"rendered":"<p><a href=\"https:\/\/jaimerios.com\/wp-content\/uploads\/2012\/04\/DragonSmall.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-1213\" title=\"llvm clang dragon\" src=\"https:\/\/jaimerios.com\/wp-content\/uploads\/2012\/04\/DragonSmall.png\" alt=\"Kick ass compiler!\" width=\"136\" height=\"136\"><\/a><\/p>\n<p>I saw this demo done at WWDC on how to turn off warnings, only when truly warranted, while compiling with clang:<\/p>\n<pre lang=\"C++\">#if defined (__clang__)\n    #pragma clang diagnostic push\n    #pragma clang diagnostic ignored \"-Wunused-value\"\n#endif \/\/ defined __clang__\n\nvoid ImAUselessLittleFunction ( int pleaseUseMe )\n{\n    pleaseUseMe; \/\/ Nope, you are not going to be used\n}\n#if defined (__clang__)\n    #pragma clang diagnostic pop\n#endif \/\/ defined __clang__\n<\/pre>\n<p>I thought this should be shared with you&#8230; You&#8217;re welcome \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I saw this demo done at WWDC on how to turn off warnings, only when truly warranted, while compiling with clang: #if defined (__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored &#8220;-Wunused-value&#8221; #endif \/\/ defined __clang__ void ImAUselessLittleFunction ( int pleaseUseMe ) { pleaseUseMe; \/\/ Nope, you are not going to be used } &#8230; <a title=\"&#8220;Selectively Disable Warnings&#8221; with clang\" class=\"read-more\" href=\"https:\/\/jaimerios.com\/?p=1212\" aria-label=\"Read more about &#8220;Selectively Disable Warnings&#8221; with clang\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[118,282,291,506],"class_list":["post-1212","post","type-post","status-publish","format-standard","hentry","category-coding","tag-clang","tag-llvm","tag-macos","tag-xcode"],"_links":{"self":[{"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/posts\/1212","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jaimerios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1212"}],"version-history":[{"count":0,"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/posts\/1212\/revisions"}],"wp:attachment":[{"href":"https:\/\/jaimerios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jaimerios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1212"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jaimerios.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}