{"action":"created","issue":{"url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/750","repository_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines","labels_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/750/labels{/name}","comments_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/750/comments","events_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/750/events","html_url":"https://github.com/isocpp/CppCoreGuidelines/issues/750","id":180421947,"number":750,"title":"C.183 states/implies that reinterpret_cast<> to char type is UB","user":{"login":"villintehaspam","id":6793377,"avatar_url":"https://avatars.githubusercontent.com/u/6793377?v=3","gravatar_id":"","url":"https://api.github.com/users/villintehaspam","html_url":"https://github.com/villintehaspam","followers_url":"https://api.github.com/users/villintehaspam/followers","following_url":"https://api.github.com/users/villintehaspam/following{/other_user}","gists_url":"https://api.github.com/users/villintehaspam/gists{/gist_id}","starred_url":"https://api.github.com/users/villintehaspam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/villintehaspam/subscriptions","organizations_url":"https://api.github.com/users/villintehaspam/orgs","repos_url":"https://api.github.com/users/villintehaspam/repos","events_url":"https://api.github.com/users/villintehaspam/events{/privacy}","received_events_url":"https://api.github.com/users/villintehaspam/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/labels/review","name":"review","color":"d4c5f9"}],"state":"open","locked":false,"assignee":{"login":"gdr-at-ms","id":11031650,"avatar_url":"https://avatars.githubusercontent.com/u/11031650?v=3","gravatar_id":"","url":"https://api.github.com/users/gdr-at-ms","html_url":"https://github.com/gdr-at-ms","followers_url":"https://api.github.com/users/gdr-at-ms/followers","following_url":"https://api.github.com/users/gdr-at-ms/following{/other_user}","gists_url":"https://api.github.com/users/gdr-at-ms/gists{/gist_id}","starred_url":"https://api.github.com/users/gdr-at-ms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdr-at-ms/subscriptions","organizations_url":"https://api.github.com/users/gdr-at-ms/orgs","repos_url":"https://api.github.com/users/gdr-at-ms/repos","events_url":"https://api.github.com/users/gdr-at-ms/events{/privacy}","received_events_url":"https://api.github.com/users/gdr-at-ms/received_events","type":"User","site_admin":false},"assignees":[{"login":"gdr-at-ms","id":11031650,"avatar_url":"https://avatars.githubusercontent.com/u/11031650?v=3","gravatar_id":"","url":"https://api.github.com/users/gdr-at-ms","html_url":"https://github.com/gdr-at-ms","followers_url":"https://api.github.com/users/gdr-at-ms/followers","following_url":"https://api.github.com/users/gdr-at-ms/following{/other_user}","gists_url":"https://api.github.com/users/gdr-at-ms/gists{/gist_id}","starred_url":"https://api.github.com/users/gdr-at-ms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdr-at-ms/subscriptions","organizations_url":"https://api.github.com/users/gdr-at-ms/orgs","repos_url":"https://api.github.com/users/gdr-at-ms/repos","events_url":"https://api.github.com/users/gdr-at-ms/events{/privacy}","received_events_url":"https://api.github.com/users/gdr-at-ms/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2016-09-30T23:26:48Z","updated_at":"2016-10-03T18:28:42Z","closed_at":null,"body":"Rule [C.183](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c183-dont-use-a-union-for-type-punning) among other things gives the advice to use a `reinterpret_cast<unsigned char*>` to look at object representations. In the comment in the code example it is claimed that the access through the resulting pointer is undefined behavior, this is likely a copy and paste error from the example above.\r\n\r\nIn the paragraph below it is stated that accessing the result of a `reinterpret_cast` to a different type is undefined behavior, which is true except when the resulting type is `char` or `unsigned char`.\r\n\r\nWhile my legalese may be failing me, I believe this is stated in rule 3.10 in the standard.\r\n\r\nFor the specific example, it might also be a good idea to add a comment that says that byte order is unspecified or similar."},"comment":{"url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/comments/251185940","html_url":"https://github.com/isocpp/CppCoreGuidelines/issues/750#issuecomment-251185940","issue_url":"https://api.github.com/repos/isocpp/CppCoreGuidelines/issues/750","id":251185940,"user":{"login":"AndrewPardoe","id":9937771,"avatar_url":"https://avatars.githubusercontent.com/u/9937771?v=3","gravatar_id":"","url":"https://api.github.com/users/AndrewPardoe","html_url":"https://github.com/AndrewPardoe","followers_url":"https://api.github.com/users/AndrewPardoe/followers","following_url":"https://api.github.com/users/AndrewPardoe/following{/other_user}","gists_url":"https://api.github.com/users/AndrewPardoe/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewPardoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewPardoe/subscriptions","organizations_url":"https://api.github.com/users/AndrewPardoe/orgs","repos_url":"https://api.github.com/users/AndrewPardoe/repos","events_url":"https://api.github.com/users/AndrewPardoe/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewPardoe/received_events","type":"User","site_admin":false},"created_at":"2016-10-03T18:28:42Z","updated_at":"2016-10-03T18:28:42Z","body":"We agree. GDR will create a PR to fix this. "}}
{"actor":{"display_login":"AndrewPardoe"}}