{"id":209,"date":"2007-02-10T23:14:41","date_gmt":"2007-02-10T21:14:41","guid":{"rendered":"https:\/\/alax.info\/blog\/209"},"modified":"2007-02-10T23:27:49","modified_gmt":"2007-02-10T21:27:49","slug":"atlassert-vs-atlassume-2","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/209","title":{"rendered":"ATLASSERT vs ATLASSUME"},"content":{"rendered":"<p>ATL of <a href=\"http:\/\/www.microsoft.com\/visualstudio\">Visual Studio 2005<\/a> contains a new interesting macro, <a href=\"http:\/\/www.google.com\/search?q=ATLASSUME+site%3Amsdn2.microsoft.com\">undocumented though<\/a>, which seems to provide a better hint for detecting bugs. Unlike documented <a href=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/h7kdewh9(VS.80).aspx\">ATLASSERT<\/a>, ATLASSUME not only asserts on failure, but also makes an infinite loop with <a href=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/ms404702(VS.80).aspx\">__analysis_assume<\/a> intrinsic inside for the <a href=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/ms404702(VS.80).aspx\">code analysis tool<\/a>. However it is also important that this intrinsic does not affect any compilation optimization, for which an <a href=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/ms404702(VS.80).aspx\">__assume<\/a> is to be used.<\/p>\n<p>It is also quite interesting to find other new macros ATLENSURE_THROW, <a href=\"http:\/\/msdn2.microsoft.com\/en-us\/ms174272(VS.80).aspx\">ATLENSURE<\/a>, ATLENSURE_SUCCEEDED and ATLENSURE_RETURN_HR, for which we had an analog since Visual C++ 6.0 and ATL3 (different shorter names though as they are very much convenient and widely used).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ATL of Visual Studio 2005 contains a new interesting macro, undocumented though, which seems to provide a better hint for detecting bugs. Unlike documented ATLASSERT, ATLASSUME not only asserts on failure, but also makes an infinite loop with __analysis_assume intrinsic inside for the code analysis tool. However it is also important that this intrinsic does&hellip; <\/p>\n<p><a class=\"moretag\" href=\"https:\/\/alax.info\/blog\/209\">Read the full article<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-209","post","type-post","status-publish","format-standard","hentry","category-atl"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/comments?post=209"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/209\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=209"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}