Skip to content
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

Build Failed Due to Warning #2

Open
SharathChampzz opened this issue Nov 30, 2020 · 0 comments
Open

Build Failed Due to Warning #2

SharathChampzz opened this issue Nov 30, 2020 · 0 comments

Comments

@SharathChampzz
Copy link

SharathChampzz commented Nov 30, 2020

Warnings were treated as errors:
warning: catching polymorphic type 'class std::bad_cast' by value [-Wcatch-value=]

Here : https://github.com/samvid25/Low-Rate-TCP-DoS-Attack/blob/master/src/mesh/model/dot11s/ie-dot11s-beacon-timing.cc
Line : 209

catch (std::bad_cast)
    {
      return false;
    }

This fixed the issue : Exceptions should be caught by constant reference, not by value.

catch (std::bad_cast& bc)
  {
     std::cerr << "bad_cast caught: " << bc.what() << '\n';
     return false;
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant