Do not shadow variables (gcc set)#8808
Conversation
d7036e6 to
d7690b3
Compare
|
Hmm, two failures in |
|
Travis fails reliably. Is the commit producing identical binaries? |
|
This commit should produce same binaries, yes. |
src/primitives/block.h
Outdated
There was a problem hiding this comment.
Hmm, this particular change is causing my clang on OS X build to fail -rescan with:
2016-09-26 19:53:08 ERROR: ReadBlockFromDisk: Deserialize or I/O error - ReadCompactSize(): size too large: unspecified iostream_category error at CBlockDiskPos(nFile=49, nPos=4208853)
So reverting it.
But do not ask me, why it is the cause... I do not know yet.
There was a problem hiding this comment.
I think I figured this out, see #8658 (comment) and the comment below that.
|
This introduces binary changes in these serialization functions: Edit: and in contrast to #8658, these do not go away with |
fca66b4 to
dd08dc7
Compare
|
OK, rebased and removed problematic parts (all serialization related, |
dd08dc7 to
416654b
Compare
|
Rebased. |
|
@MarcoFalke Marco, can you please test for the same binaries here? |
|
There seems to be a small diff: 319294c319294
< 17d0f1: lea 0x2dd1b2(%rip),%rdi # 45a2aa <leveldb::Status::Status(leveldb::Status::Code, leveldb::Slice const&, leveldb::Slice const&)::__PRETTY_FUNCTION__+0xaa>
---
> 17d0f1: lea 0x2dd1b1(%rip),%rdi # 45a2a9 <leveldb::Status::Status(leveldb::Status::Code, leveldb::Slice const&, leveldb::Slice const&)::__PRETTY_FUNCTION__+0xa9>used the following command: commit=416654b4bdcc9f91cf84d4e3c645826d62979c1d && git checkout bitcoin/master && git reset --hard HEAD && curl https://raw.githubusercontent.com/laanwj/bitcoin-maintainer-tools/6e4425587736144b067f67ad792d9ee904e74fd7/patches/stripbuildinfo.patch | patch -p 1 && make -j 2 && objdump -d -r -C --no-show-raw-insn src/bitcoind > /tmp/d_old && curl https://github.com/bitcoin/bitcoin/commit/"${commit}".diff | patch -p 1 && make -j 2 && objdump -d -r -C --no-show-raw-insn src/bitcoind > /tmp/d_new && diff /tmp/d_old /tmp/d_new | wc |
|
This seems unrelated. |
|
I haven't done the identical binary checking yet, but it looks like the difference could be here ? 170 (0xaa) vs 169 (0xa9) |
|
@fanquake surely not... |
|
JFYI: I'm now building with other gcc version and there are a few other warnings 8) |
src/arith_uint256.cpp
Outdated
|
Concept ACK when this is the last patch/pull with regard to Wshadow. |
gmaxwell
left a comment
There was a problem hiding this comment.
filling up locals with _ prefixes in big pieces of code is less good than using better names, and also incompatible with a common convention of using _prefixes for function parameters.
src/streams.h
Outdated
src/timedata.h
Outdated
There was a problem hiding this comment.
I like vSortedSize, will do.
src/primitives/transaction.h
Outdated
There was a problem hiding this comment.
sflags (this was less obvious to me, but my suggestion and @sipa thought it was okay)
src/wallet/wallet.cpp
Outdated
There was a problem hiding this comment.
So I believe changing the name of CCryptoKeyStore master key will, I think change only four lines. Might be good to get an opinion from someone who's worked more on this code? @TheBlueMatt @pstratem
There was a problem hiding this comment.
That would be great and even better solution, yes. Will wait.
|
I checked each of the changes so far, they appear correct to me (+/- the suggestion I made about changing the name of the member vMasterKey that I asked for others input on). I didn't check that they resulted in the same code. |
416654b to
bedf9a7
Compare
|
Rebased, updated. It is now |
|
@paveljanik Mind to cherry-pick fd5654c, so we don't have to open another pull? |
Followup to #8105.
The current set of PRs made
clangcompileWshadowclean. Compiling withgccrevealed new needed changes.gccis more strict in warnings. This is non-Qt part. I do not have an environment to testgcc+Qt build now.