Fix exception warning (patch)
Moderator: Committer
-
- Space Squid
- Posts: 66
- Joined: Mon Aug 27, 2012 7:24 pm
Fix exception warning (patch)
There are nine places where exceptions are caught by value instead of by reference. Attached is a trivial patch to change these to const&.
- Attachments
-
- fix-exception-warnings.diff.txt
- (3.77 KiB) Downloaded 133 times
All contributions are submitted under GPL or LGPL v2 or later, or under appropriate Creative Commons licence, consistent with project guidlines.
Re: Fix exception warning (patch)
What about to open PR on the Github?spikethehobbit wrote: ↑Thu Oct 31, 2019 10:55 am There are nine places where exceptions are caught by value instead of by reference. Attached is a trivial patch to change these to const&.
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-01-30.0dd6806.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-01-30.0dd6806.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm
-
- Space Squid
- Posts: 66
- Joined: Mon Aug 27, 2012 7:24 pm
Re: Fix exception warning (patch)
I closed my Github account when Microsoft bought them.o01eg wrote: ↑Thu Oct 31, 2019 11:03 amWhat about to open PR on the Github?spikethehobbit wrote: ↑Thu Oct 31, 2019 10:55 am There are nine places where exceptions are caught by value instead of by reference. Attached is a trivial patch to change these to const&.
All contributions are submitted under GPL or LGPL v2 or later, or under appropriate Creative Commons licence, consistent with project guidlines.
Re: Fix exception warning (patch)
I have created a PR with this patch: #2625
-
- Space Squid
- Posts: 66
- Joined: Mon Aug 27, 2012 7:24 pm
Re: Fix exception warning (patch)
Sorry for the delay. There are nine changed lines in the submitted patch, of which only six were applied. Geoff's suggestion of using catch (...) is a viable alternative in several cases as noted.
The following files are each missing one change:
network/Message.cpp
server/ServerApp.cpp
util/Directories.cpp
The following files are each missing one change:
network/Message.cpp
server/ServerApp.cpp
util/Directories.cpp
All contributions are submitted under GPL or LGPL v2 or later, or under appropriate Creative Commons licence, consistent with project guidlines.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13586
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Fix exception warning (patch)
Should that get cherry picked into the release branch?Geoff the Medio wrote: ↑Sun Dec 08, 2019 10:43 am https://github.com/freeorion/freeorion/ ... dfb87e2fa4
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13586
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Fix exception warning (patch)
https://github.com/freeorion/freeorion/ ... 83a6b42cecVezzra wrote: ↑Sun Dec 08, 2019 7:34 pmShould that get cherry picked into the release branch?Geoff the Medio wrote: ↑Sun Dec 08, 2019 10:43 am https://github.com/freeorion/freeorion/ ... dfb87e2fa4
Re: Fix exception warning (patch)
Oh, good. Should have checked before asking... ![Wink ;)](./images/smilies/icon_wink.gif)
![Wink ;)](./images/smilies/icon_wink.gif)