{"action":"closed","issue":{"url":"https://api.github.com/repos/bitcoin/bitcoin/issues/12732","repository_url":"https://api.github.com/repos/bitcoin/bitcoin","labels_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/12732/labels{/name}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/12732/comments","events_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/12732/events","html_url":"https://github.com/bitcoin/bitcoin/issues/12732","id":306714845,"number":12732,"title":"msvc compile broken by new varint encoding checks","user":{"login":"sipsorcery","id":197660,"avatar_url":"https://avatars0.githubusercontent.com/u/197660?v=4","gravatar_id":"","url":"https://api.github.com/users/sipsorcery","html_url":"https://github.com/sipsorcery","followers_url":"https://api.github.com/users/sipsorcery/followers","following_url":"https://api.github.com/users/sipsorcery/following{/other_user}","gists_url":"https://api.github.com/users/sipsorcery/gists{/gist_id}","starred_url":"https://api.github.com/users/sipsorcery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sipsorcery/subscriptions","organizations_url":"https://api.github.com/users/sipsorcery/orgs","repos_url":"https://api.github.com/users/sipsorcery/repos","events_url":"https://api.github.com/users/sipsorcery/events{/privacy}","received_events_url":"https://api.github.com/users/sipsorcery/received_events","type":"User","site_admin":false},"labels":[{"id":234877,"url":"https://api.github.com/repos/bitcoin/bitcoin/labels/Windows","name":"Windows","color":"884400","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-03-20T03:19:11Z","updated_at":"2018-03-21T03:01:34Z","closed_at":"2018-03-21T03:01:34Z","author_association":"CONTRIBUTOR","body":"The commit for #9573 has broken the ability to compile libbitcoin_server and the test and bench programs.\r\n\r\nThe compiler error is:\r\n\r\n> Error\tC2338\tSigned type required with mode NONNEGATIVE_SIGNED.\tlibbitcoin_server\tf:\\dev\\github\\bitcoin-msvc\\src\\serialize.h\t316\t\r\n\r\nIt looks like the static_assert in serialize.h is now more aggressively checking inputs. I've tracked down one of the static_assert triggers to a change from the same commit in blockchain.cpp line 838:\r\n\r\n`ss << VARINT(outputs.begin()->second.nHeight * 2 + outputs.begin()->second.fCoinBase, VarIntMode::NONNEGATIVE_SIGNED);`\r\n\r\nChanging the VarIntMode to DEFAULT removes one of the errors. From my inspection the two fields being encoded are both uint's so shouldn't need the NONNEGATIVE_SIGNED mode (of course that may be different with non-msvc compilers):\r\n\r\noutputs.begin()->second.nHeight is uint32_t\r\noutputs.begin()->second.fCoinBase is unsigned int\r\n\r\nI'm not really sure what the best approach to fix this is but am happy to do any further investigation if required.\r\n"}}
{"actor":{"display_login":"fanquake"}}