{"id":11911,"date":"2024-01-16T12:02:08","date_gmt":"2024-01-16T17:02:08","guid":{"rendered":"https:\/\/irreal.org\/blog\/?p=11911"},"modified":"2024-01-16T12:02:08","modified_gmt":"2024-01-16T17:02:08","slug":"a-fatal-c-error","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=11911","title":{"rendered":"A Fatal C Error"},"content":{"rendered":"<p>\nIf you&rsquo;ve been around Irreal for a while, you know that I spent the majority of my software career writing C code. I love C and don&rsquo;t have a lot of patience for snark about it from those who have never bothered to master it or even use it non-trivially.\n<\/p>\n<p>\nStill, I can promise you that given 500,000 lines of C you&rsquo;re going to find errors. Probably lots of them. Who would want to put their safety or even their lives in the care of such a monster? Yet that&rsquo;s exactly what we all do everyday. Modern automobiles are run almost entirely by computers running probably millions of lines of code. If you&rsquo;re a software developer, this should terrify you.\n<\/p>\n<p>\nHere&rsquo;s a <a href=\"https:\/\/www.youtube.com\/watch?v=bJyE9OUhhAM&amp;t=606s\">case in point<\/a>. Toyota&rsquo;s cars have\u2014or at least had\u2014an acceleration system run by over 500,000 lines of C code. After more than a decade of &ldquo;sudden unintended acceleration&rdquo; incidents and several recalls in which Toyota blamed floor mats getting stuck under the accelerators, one victim hired a couple of embedded system engineers to examine the code. Toyota, of course, vigorously objected but the review took splace anyway. I&rsquo;ll let you watch the video to see what they found.\n<\/p>\n<p>\nIn some ways, the video is an advertisement for Rust. At the end, the narrator says that these problems could be ameliorated by using a &ldquo;safe&rdquo; language like Rust. Those of us who have been around for a while know there&rsquo;s no such thing. On the other hand, C probably isn&rsquo;t the best choice for this sort of application.\n<\/p>\n<p>\nNASA famously uses C safely but they have an extraordinarily comprehensive review and testing process and <i>very<\/i> strict coding standards. No automobile manufacturer is going to\u2014or probably could afford to\u2014run a similar program. It makes you yearn for the old days of mechanical interfaces.\n<\/p>\n<p>\nIt&rsquo;s an interesting video. It&rsquo;s 10 minutes, 6 seconds long so it should be easy to fit in.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&rsquo;ve been around Irreal for a while, you know that I spent the majority of my software career writing C code. I love C and don&rsquo;t have a lot of patience for snark about it from those who have &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=11911\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[37],"class_list":["post-11911","post","type-post","status-publish","format-standard","hentry","category-general","tag-tech"],"_links":{"self":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/11911","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11911"}],"version-history":[{"count":1,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/11911\/revisions"}],"predecessor-version":[{"id":11912,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/11911\/revisions\/11912"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11911"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11911"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11911"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}