{"id":10462,"date":"2015-01-13T10:12:48","date_gmt":"2015-01-13T15:12:48","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=10462"},"modified":"2015-01-13T10:12:48","modified_gmt":"2015-01-13T15:12:48","slug":"undefined-behavior-in-c","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2015\/01\/13\/undefined-behavior-in-c\/","title":{"rendered":"Undefined Behavior in C"},"content":{"rendered":"<p><a href=\"https:\/\/news.ycombinator.com\/item?id=8834896\">Mike Ash<\/a> (via <a href=\"https:\/\/twitter.com\/danielpunkass\/status\/551819489680314371\">Daniel Jalkut<\/a>):<\/p>\n<blockquote cite=\"https:\/\/news.ycombinator.com\/item?id=8834896\"><p>It&rsquo;s possible to invoke undefined behavior in your function. Undefined behavior can mean something never terminates. Thus, it&rsquo;s possible for your function to never terminate.<\/p><p>If you don&rsquo;t believe me, I pose the following challenge: give me an implementation of this function. I will then provide a chunk of code that calls it and causes it to enter an infinite loop.<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Mike Ash (via Daniel Jalkut): It&rsquo;s possible to invoke undefined behavior in your function. Undefined behavior can mean something never terminates. Thus, it&rsquo;s possible for your function to never terminate.If you don&rsquo;t believe me, I pose the following challenge: give me an implementation of this function. I will then provide a chunk of code that [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[45,46,71],"class_list":["post-10462","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-c","tag-languagedesign","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/10462","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=10462"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/10462\/revisions"}],"predecessor-version":[{"id":10463,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/10462\/revisions\/10463"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=10462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=10462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=10462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}