dtr-org / unit-e

A digital currency for a new era of decentralized trust
https://unit-e.io
MIT License
45 stars 15 forks source link

Fix GCC warnings in prevector.h by initializing class fields #1047

Closed cmihai closed 5 years ago

cmihai commented 5 years ago

This PR cherry-picks a Bitcoin commit which fixes GCC's -Wmaybe-uninitialized for a couple of methods in prevector.h.

frolosofsky commented 5 years ago

Are there any difficulties to fix the actual warning instead? Even well test covered code could flake because of uninitialized variables.

scravy commented 5 years ago

The code is not any different in bitcoin. So I guess the warning is supressed in bitcoin differently, yet the code is the same. It does not look beneficial to me to change prevector from what bitcoin is having, except it was done also on bitcoin.

cmihai commented 5 years ago

https://github.com/bitcoin/bitcoin/pull/14028 is what Bitcoin does. Their code landed in 0.18, probably, so we could just close this PR and cherry-pick their commit.

frolosofsky commented 5 years ago

Yeah I suggest cherry-pick their commit. It's interesting that they went exactly the same path: suppress warning (https://github.com/bitcoin/bitcoin/pull/13902), and then fix them instead (https://github.com/bitcoin/bitcoin/pull/14028)

cmihai commented 5 years ago

I cherry-picked their commit. After Travis finishes, it will need to be regular-merged into master.

frolosofsky commented 5 years ago

utACK 142eec4621486d919700a2a6ecfd0ed8c38a40aa

Please make sure to update PR description as well as commit message. This should go as merge-commit, right?