Do not shadow upper local variable 'send', prevent -Wshadow compiler warning. #8677

pull paveljanik wants to merge 1 commits into bitcoin:master from paveljanik:20160907_Wshadow_8606 changing 1 files +3 −3
  1. paveljanik commented at 11:53 AM on September 7, 2016: contributor

    Fixes new -Wshadow (#8105) warning from #8606:

    Making all in src
      CXX      libbitcoin_server_a-main.o
    main.cpp:4792:30: warning: declaration shadows a local variable [-Wshadow]
                            bool send = false;
                                 ^
    main.cpp:4748:22: note: previous declaration is here
                    bool send = false;
                         ^
    1 warning generated.
    

    It would be nice to get rid of it completely and sending merkleblock only when something like merkleBlock.initialized(), but there is no getter now and all properties are marked as public only for unit testing.

  2. Do not shadow upper local variable 'send', prevent -Wshadow compiler warning. 125b946cb4
  3. sipa commented at 12:40 PM on September 7, 2016: member

    utACK

  4. MarcoFalke added the label Refactoring on Sep 7, 2016
  5. MarcoFalke commented at 5:24 PM on September 7, 2016: member

    utACK 125b946

  6. dcousens commented at 12:07 AM on September 8, 2016: contributor

    utACK 125b946

  7. laanwj commented at 8:07 AM on September 9, 2016: member

    Fixes new -Wshadow (#8105) warning from #8606:

    Looks like these are being introduced faster than they can be cleaned up...

  8. laanwj commented at 8:25 AM on September 9, 2016: member

    So maybe it's time to enable this warning in the default bulid?

    Anyhow, executables match, ACK 125b946

  9. laanwj merged this on Sep 9, 2016
  10. laanwj closed this on Sep 9, 2016

  11. laanwj referenced this in commit 4daf02a03f on Sep 9, 2016
  12. paveljanik commented at 9:54 AM on September 9, 2016: contributor

    Not yet, I think. There are approx. 500 of these warnings in Qt 8)

  13. sipa commented at 9:55 AM on September 9, 2016: member

    Is it possible to only compile everything not UI with -Wshadow ?

  14. paveljanik commented at 10:01 AM on September 9, 2016: contributor

    There surely is a way to disable -Wshadow for qt ;-)

  15. mmeijeri commented at 10:11 AM on September 9, 2016: none

    We shouldn't be making lots of changes to local variable names because they conflict with a global variable. That's just treating the symptoms, we need to address the root cause, which is the large number of globals.

  16. paveljanik commented at 10:17 AM on September 9, 2016: contributor

    There is almost no change like you describe (tableRPC being an exception). You are stating pure truth though.

  17. codablock referenced this in commit 27eaa2ef05 on Sep 19, 2017
  18. codablock referenced this in commit 20d79eaa5d on Jan 9, 2018
  19. codablock referenced this in commit 0324fa0121 on Jan 9, 2018
  20. andvgal referenced this in commit ee6ef30733 on Jan 6, 2019
  21. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-15 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me