{"action":"created","issue":{"url":"https://api.github.com/repos/mapbox/protozero/issues/66","repository_url":"https://api.github.com/repos/mapbox/protozero","labels_url":"https://api.github.com/repos/mapbox/protozero/issues/66/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/protozero/issues/66/comments","events_url":"https://api.github.com/repos/mapbox/protozero/issues/66/events","html_url":"https://github.com/mapbox/protozero/issues/66","id":189457884,"number":66,"title":"1.4.3 fails to build on big endian architectures: invalid use of incomplete type","user":{"login":"sebastic","id":4605306,"avatar_url":"https://avatars.githubusercontent.com/u/4605306?v=3","gravatar_id":"","url":"https://api.github.com/users/sebastic","html_url":"https://github.com/sebastic","followers_url":"https://api.github.com/users/sebastic/followers","following_url":"https://api.github.com/users/sebastic/following{/other_user}","gists_url":"https://api.github.com/users/sebastic/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastic/subscriptions","organizations_url":"https://api.github.com/users/sebastic/orgs","repos_url":"https://api.github.com/users/sebastic/repos","events_url":"https://api.github.com/users/sebastic/events{/privacy}","received_events_url":"https://api.github.com/users/sebastic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-15T17:38:09Z","updated_at":"2016-11-15T18:56:32Z","closed_at":null,"body":"The protobuf 1.4.3 Debian package failed to build on [s390x](https://buildd.debian.org/status/fetch.php?pkg=protozero&arch=s390x&ver=1.4.3-1~exp1&stamp=1479225018), [hppa](https://buildd.debian.org/status/fetch.php?pkg=protozero&arch=hppa&ver=1.4.3-1%7Eexp1&stamp=1479225459), [powerpc](https://buildd.debian.org/status/fetch.php?pkg=protozero&arch=powerpc&ver=1.4.3-1~exp1&stamp=1479224804) & [ppc64](https://buildd.debian.org/status/fetch.php?pkg=protozero&arch=ppc64&ver=1.4.3-1~exp1&stamp=1479224363) (all big endian),\r\nit looks like the endian changes are insufficient:\r\n```\r\ng++ -c -Iinclude -Itest/include -g -O2 -fdebug-prefix-map=/«PKGBUILDDIR»=. -fstack-protector-strong -Wformat -Werror=format-security -fvisibility-inlines-hidden -std=c++11 -Wall -Wextra -pedantic -Wsign-compare -Wsign-conversion -Wunused-parameter -Wno-float-equal -Wno-covered-switch-default -Wshadow -O0 -g -fno-inline-functions test/t/uint32/test_cases.cpp -o test/t/uint32/test_cases.o\r\nIn file included from /usr/include/c++/6/bits/move.h:57:0,\r\n                 from /usr/include/c++/6/bits/nested_exception.h:40,\r\n                 from /usr/include/c++/6/exception:171,\r\n                 from /usr/include/c++/6/ios:39,\r\n                 from /usr/include/c++/6/istream:38,\r\n                 from /usr/include/c++/6/sstream:38,\r\n                 from test/include/catch.hpp:70,\r\n                 from test/include/test.hpp:6,\r\n                 from test/t/uint32/test_cases.cpp:2:\r\n/usr/include/c++/6/type_traits: In instantiation of 'struct std::make_unsigned<float>':\r\ninclude/protozero/byteswap.hpp:56:42:   required from 'void protozero::detail::byteswap_inplace(T&) [with T = float]'\r\ninclude/protozero/pbf_reader.hpp:80:33:   required from 'T protozero::pbf_reader::get_fixed() [with T = float]'\r\ninclude/protozero/pbf_reader.hpp:572:33:   required from here\r\n/usr/include/c++/6/type_traits:1831:62: error: invalid use of incomplete type 'class std::__make_unsigned_selector<float, false, false>'\r\n     { typedef typename __make_unsigned_selector<_Tp>::__type type; };\r\n                                                              ^~~~\r\n/usr/include/c++/6/type_traits:1788:11: note: declaration of 'class std::__make_unsigned_selector<float, false, false>'\r\n     class __make_unsigned_selector;\r\n           ^~~~~~~~~~~~~~~~~~~~~~~~\r\n```"},"comment":{"url":"https://api.github.com/repos/mapbox/protozero/issues/comments/260732484","html_url":"https://github.com/mapbox/protozero/issues/66#issuecomment-260732484","issue_url":"https://api.github.com/repos/mapbox/protozero/issues/66","id":260732484,"user":{"login":"daniel-j-h","id":527241,"avatar_url":"https://avatars.githubusercontent.com/u/527241?v=3","gravatar_id":"","url":"https://api.github.com/users/daniel-j-h","html_url":"https://github.com/daniel-j-h","followers_url":"https://api.github.com/users/daniel-j-h/followers","following_url":"https://api.github.com/users/daniel-j-h/following{/other_user}","gists_url":"https://api.github.com/users/daniel-j-h/gists{/gist_id}","starred_url":"https://api.github.com/users/daniel-j-h/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniel-j-h/subscriptions","organizations_url":"https://api.github.com/users/daniel-j-h/orgs","repos_url":"https://api.github.com/users/daniel-j-h/repos","events_url":"https://api.github.com/users/daniel-j-h/events{/privacy}","received_events_url":"https://api.github.com/users/daniel-j-h/received_events","type":"User","site_admin":false},"created_at":"2016-11-15T18:56:31Z","updated_at":"2016-11-15T18:56:31Z","body":"This here needs to be conditional (see http://en.cppreference.com/w/cpp/types/make_unsigned) otherwise it's Undefined Behavior for types where there is no unsigned type equivalent (e.g. floats). The stdlib is nice and just fails to compile: https://github.com/mapbox/protozero/commit/a0feac5e22b8fb5f059f296f642f7c272fd1e473#diff-6c7bee11890feee852c8538f2879b852R56\r\n\r\n> If T is an integral (except bool) or enumeration type, provides the member typedef type which is the unsigned integer type corresponding to T, with the same cv-qualifiers.\r\n\r\n> Otherwise, the behavior is undefined. \r\n\r\nWas introduced in the byte swap fix for Undefined Behavior."}}
{"actor":{"display_login":"daniel-j-h"}}