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

GCC 8 catch value warning #1

Open
iandinwoodie opened this issue Nov 28, 2018 · 0 comments
Open

GCC 8 catch value warning #1

iandinwoodie opened this issue Nov 28, 2018 · 0 comments

Comments

@iandinwoodie
Copy link

@kohler I attempted to make a fork of this repository to resolve the issue myself and open a PR, but the fork was public. Neither of us wants that, so I deleted the fork immediately.

Line 375 in pset6/pong61.cc attempts to catch a polymorphic class type by value:

    } catch (std::system_error err) {

This throws a warning due to the -Wcatch-value option (enabled by -Wall at pset6/build/rules.mk:6):

pong61.cc:375:36: warning: catching polymorphic type ‘class std::system_error’ by value [-Wcatch-value=]
         } catch (std::system_error err) {

The warning can be resolved by catching the system error by reference:

    } catch (std::system_error& err) {
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