{"id":472,"date":"2022-08-30T15:01:55","date_gmt":"2022-08-30T15:01:55","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/when-endianess-does-matter-cast-operations-duplicate-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:01:55","modified_gmt":"2022-08-30T15:01:55","slug":"when-endianess-does-matter-cast-operations-duplicate-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/when-endianess-does-matter-cast-operations-duplicate-collection-of-common-programming-errors\/","title":{"rendered":"when endianess does matter &#8211; cast operations [duplicate]-Collection of common programming errors"},"content":{"rendered":"<p>Don\u2019t forget that the compiler will only write assembly code. If you ignore all the warnings that the compiler, you can examine the assembly code produced by the compiler and figure out what really happens.<\/p>\n<p>I took this simple program:<\/p>\n<pre><code>#include \n\nint main()\n{\n    unsigned endian[2] = { 0, 0 } ;\n    long * casted_endian = reinterpret_cast( endian );\n    std::cout<\/code><\/pre>\n<p id=\"rop\"><small>Originally posted 2013-11-09 19:44:15. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>Don\u2019t forget that the compiler will only write assembly code. If you ignore all the warnings that the compiler, you can examine the assembly code produced by the compiler and figure out what really happens. I took this simple program: #include int main() { unsigned endian[2] = { 0, 0 } ; long * casted_endian [&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-472","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/472","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=472"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/472\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=472"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=472"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=472"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}