{"action":"opened","issue":{"url":"https://api.github.com/repos/vrpn/vrpn/issues/117","labels_url":"https://api.github.com/repos/vrpn/vrpn/issues/117/labels{/name}","comments_url":"https://api.github.com/repos/vrpn/vrpn/issues/117/comments","events_url":"https://api.github.com/repos/vrpn/vrpn/issues/117/events","html_url":"https://github.com/vrpn/vrpn/issues/117","id":112882003,"number":117,"title":"vrpn_big_endian","user":{"login":"rpavlik","id":61129,"avatar_url":"https://avatars.githubusercontent.com/u/61129?v=3","gravatar_id":"","url":"https://api.github.com/users/rpavlik","html_url":"https://github.com/rpavlik","followers_url":"https://api.github.com/users/rpavlik/followers","following_url":"https://api.github.com/users/rpavlik/following{/other_user}","gists_url":"https://api.github.com/users/rpavlik/gists{/gist_id}","starred_url":"https://api.github.com/users/rpavlik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rpavlik/subscriptions","organizations_url":"https://api.github.com/users/rpavlik/orgs","repos_url":"https://api.github.com/users/rpavlik/repos","events_url":"https://api.github.com/users/rpavlik/events{/privacy}","received_events_url":"https://api.github.com/users/rpavlik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-22T20:11:35Z","updated_at":"2015-10-22T20:11:35Z","closed_at":null,"body":"The current approach uses a static variable declared in a header file, so we get a ton of these warnings, one in nearly every source file:\r\n\r\n```\r\nvrpn_Shared.h:210:19: warning: 'vrpn_big_endian' defined but not used [-Wunused-variable]\r\n static const bool vrpn_big_endian = (vrpn_char_data_for_endian_test[0] != 1);\r\n```\r\n\r\nI'm not sure the current approach is even necessarily safe (think we should just be doing a `reinterpret_cast<const char *>` since aliased access through a character type is explicitly permitted by the standard), but furthermore, on most platforms there's a preprocessor definition that can provide a more complete endianness answer at preprocessor time (cf. <https://github.com/boostorg/predef/blob/develop/include/boost/predef/other/endian.h> ), not just at optimize time (I'm hoping that variable gets optimized out...)\r\n\r\nOf course, the hairy part is, this is in a public header, and I don't know who is all consuming it. If nothing else, it should be moved to a separate header to be included if desired, and preferably it should be removed entirely except in cases where it's a really old/obscure machine and so the typical endianness definitions won't suffice."}}