{"id":8993,"date":"2011-12-01T07:00:00","date_gmt":"2011-12-01T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2011\/12\/01\/our-code-needs-to-run-on-multiple-platforms-with-different-rules-so-we-follow-none-of-them\/"},"modified":"2011-12-01T07:00:00","modified_gmt":"2011-12-01T07:00:00","slug":"our-code-needs-to-run-on-multiple-platforms-with-different-rules-so-we-follow-none-of-them","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20111201-00\/?p=8993","title":{"rendered":"Our code needs to run on multiple platforms with different rules, so we follow none of them!"},"content":{"rendered":"<p>A customer was encountering sporadic crashes in their 64-bit application, and upon investigation, the problem was traced to a misaligned RSP register. <a href=\"http:\/\/blogs.msdn.com\/b\/oldnewthing\/archive\/2004\/01\/14\/58579.aspx\"> We saw some time ago<\/a> that <a href=\"http:\/\/msdn.microsoft.com\/library\/ew5tede7.aspx\"> the Windows x64 calling convention requires the RSP register to be 16-byte aligned<\/a>.\n The customer traced the source of the misalignment to a third-party library they were using. They contacted the vendor, who acknowledged that they were not following <a href=\"http:\/\/msdn.microsoft.com\/library\/7kcdt6fy.aspx\"> the Windows x64 calling conventions<\/a>, but explained that their code needs to run on multiple x64 operating systems, and since each operating system has different calling conventions, they adhere to none of them!<\/p>\n<p> I was kind of boggled by this remark. Yes, it&#8217;s frustrating that different operating systems have different calling conventions, but that doesn&#8217;t mean that you are welcome to ignore them. Every region of the world has different laws regarding the operation of motorized vehicles, but that doesn&#8217;t mean &#8220;My truck driver has to drive through all these different jurisdictions with different rules, so he follows none of them!&#8221; <\/p>\n","protected":false},"excerpt":{"rendered":"<p>A customer was encountering sporadic crashes in their 64-bit application, and upon investigation, the problem was traced to a misaligned RSP register. We saw some time ago that the Windows x64 calling convention requires the RSP register to be 16-byte aligned. The customer traced the source of the misalignment to a third-party library they were [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[26],"class_list":["post-8993","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-other"],"acf":[],"blog_post_summary":"<p>A customer was encountering sporadic crashes in their 64-bit application, and upon investigation, the problem was traced to a misaligned RSP register. We saw some time ago that the Windows x64 calling convention requires the RSP register to be 16-byte aligned. The customer traced the source of the misalignment to a third-party library they were [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/8993","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=8993"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/8993\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=8993"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=8993"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=8993"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}