{"id":234,"date":"2022-08-30T14:57:57","date_gmt":"2022-08-30T14:57:57","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/08\/31\/why-is-this-undefined-behavior-when-i-always-get-the-same-result-record-and-share-programming-errors\/"},"modified":"2022-08-30T14:57:57","modified_gmt":"2022-08-30T14:57:57","slug":"why-is-this-undefined-behavior-when-i-always-get-the-same-result-record-and-share-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/why-is-this-undefined-behavior-when-i-always-get-the-same-result-record-and-share-programming-errors\/","title":{"rendered":"Why is this undefined behavior when I always get the same result?-Record and share programming errors"},"content":{"rendered":"<p>&#8220;Undefined&#8221; means that the standard doesn&#8217;t specify what has to happen in that situation, so anything your compiler does is, by definition, right. If it always prints <code>01<\/code>, that&#8217;s fine. If it prints a different number every time you run, that would be fine too. If it causes monkeys to fly out of your nose (as illustrated here), that would be fine as well.<\/p>\n<p>You might not think so, but the compiler writers are off the hook if it happens.<\/p>\n<p>[Edit: It has been pointed out in the comments that the cannonical reference is &#8220;nasal demons&#8221;, not &#8220;nasal monkeys&#8221;. My apologies for any unintended confusion. Any <em>intended confusion<\/em> I&#8217;m proud of and do not apologize for. \ud83d\ude42 ]<\/p>\n<p id=\"rop\"><small>Originally posted 2013-08-31 05:39:39. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>&#8220;Undefined&#8221; means that the standard doesn&#8217;t specify what has to happen in that situation, so anything your compiler does is, by definition, right. If it always prints 01, that&#8217;s fine. If it prints a different number every time you run, that would be fine too. If it causes monkeys to fly out of your nose [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-234","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/234","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=234"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/234\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=234"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=234"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=234"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}