-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Do not shadow in src/qt #8793
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not shadow in src/qt #8793
Conversation
Awesome, will check. |
Please note that many places could be rewritten to use member initializers. And on many places, the diff can be shortened by rewriting initialization process, simplifying |
Right, the goal is easy review and checking, as well as being able to enable those warnings by default after this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Binaries match
f1916a25418f7a2dac48f142fb56466e6c2d68197f8f1787b68317c1ec62d281 /tmp/compare/bitcoind.26b370a
dff7a8d163c1543fe4044b1bc2e70af1d4fa3d3bc2b8b9ded0635b312c7d1534 /tmp/compare/bitcoind.26b370a.stripped
f1916a25418f7a2dac48f142fb56466e6c2d68197f8f1787b68317c1ec62d281 /tmp/compare/bitcoind.eec927e
dff7a8d163c1543fe4044b1bc2e70af1d4fa3d3bc2b8b9ded0635b312c7d1534 /tmp/compare/bitcoind.eec927e.stripped
Eh, oops I checked the bitcoind binary while this relates to bitcoin-qt, need to recheck. |
My binary comparator finds differences in the following functions:
These are just the constructors, even empty ones. I don't see why, it may have something to do with Qt's moc generating different metadata? ut/code review ACK 46b15bb Edit: new commit removes two functions from the list |
Would be interesting to know why the binaries don't match for qt. Encountered the same here: #8658 (comment) |
The difference cause by this PR is probably different from the difference caused by #8658. In this PR, the change in 46b15bb illustrates the reason. Technically it does the same, but compiler has two places where to get the value used (member variable initialized from the argument or the argument itself). |
@MarcoFalke yes we figured it out on IRC: it has to do with name binding, using the argument versus member variable it was assigned to. For example this seems to make the differences in AddressBookPage::AddressBookPage go away: http://www.hastebin.com/jixoyufuxu.patch . But that's kind of ugly. So in this case I prefer slightly different executables to larger source code patch that makes the code uglier. If it was consensus code it'd be different. |
46b15bb
to
f839350
Compare
Squashed the squashme commit. |
f839350 Do not shadow in src/qt (Pavel Janík)
f839350 Do not shadow in src/qt (Pavel Janík)
f839350 Do not shadow in src/qt (Pavel Janík)
As requested by @laanwj in #8105, Qt shadowing changes all-in-one.
Maintainers allowed to edit.