Fixing warning C4101: unreferenced local variable #4821

pull ENikS wants to merge 1 commits into bitcoin:master from ENikS:C4101_fix changing 9 files +10 −10
  1. ENikS commented at 7:34 PM on September 2, 2014: contributor

    No description provided.

  2. Fixing C4101 warning 4d7d387734
  3. in src/rpcserver.cpp:None in 4d7d387734
     627 | @@ -628,7 +628,7 @@ void StartRPCThreads()
     628 |              try {
     629 |                  vEndpoints.push_back(ParseEndpoint(addr, defaultPort));
     630 |              }
     631 | -            catch(boost::system::system_error &e)
     632 | +            catch(...)
    


    sipa commented at 7:37 PM on September 2, 2014:

    This is not exactly equivalent (haven't verified whether it matters).


    ENikS commented at 7:46 PM on September 2, 2014:

    'e' is not being used and it is faster because type of exception is not being checked.


    sipa commented at 7:47 PM on September 2, 2014:

    But now this block will catch all types of exceptions, instead of just boost::system::system_error ones, which may not be the intention.


    ENikS commented at 8:04 PM on September 2, 2014:

    Well, it might be so but unlikely. Judging from the fact that boost::system_error derived from std::runtime_error it would be safe to assume that intention was to handle any abnormal condition.


    gavinandresen commented at 8:16 PM on September 2, 2014:

    NAK on replacing with catch (...). We want errors like std::bad_alloc (out of memory) to either be handled by a higher-level catch or to cause an unhandled exception exit.

  4. BitcoinPullTester commented at 7:48 PM on September 2, 2014: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4821_4d7d387734f5643bf95af8ffc681534b755c558b/ for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.

  5. ENikS commented at 9:15 PM on September 2, 2014: contributor

    Fair enough, will approach it differently.

  6. ENikS closed this on Sep 2, 2014

  7. ENikS deleted the branch on Sep 2, 2014
  8. laanwj commented at 6:08 AM on September 3, 2014: member

    You could remove the e instead of the entire clause?

    Agree that this is the wrong solution, never make catch clauses more general than they should be.

  9. ENikS commented at 4:54 AM on September 5, 2014: contributor

    @laanwj It was my next step.

  10. DrahtBot 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-18 21:15 UTC

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