[SERVER-44856] Turn on -Wunused-exception-parameter for clang builds Created: 26/Nov/19 Updated: 29/Oct/23 Resolved: 03/Dec/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Build |
| Affects Version/s: | None |
| Fix Version/s: | 4.3.3 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Matthew Russotto | Assignee: | Andrew Morrow (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Sprint: | Dev Platform 2019-12-16 | ||||||||
| Participants: | |||||||||
| Description |
|
Currently our windows builds will fail with an error "C2220" if an exception parameter is unused (e.g. try {} catch (const DBException&e) { log() << "whatever"; throw;}). However non-Windows builds do not fail, resulting in the failure first being noticed on evergreen or worse, after push. Clang has an option -Wunused-exception-parameter; if this was turned on, developers using clang would catch it earlier. Unfortuately it appears GCC does not have an equivalent. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90353 |
| Comments |
| Comment by Githook User [ 03/Dec/19 ] |
|
Author: {'name': 'Andrew Morrow', 'email': 'andrew.morrow@10gen.com'}Message: |
| Comment by Andrew Morrow (Inactive) [ 02/Dec/19 ] |
|
I'm happy to try this out. If it works when applied at the top of the tree, then I think we can just commit it. If it would require further work (specifically, if there are third-party libraries which trigger the warning) I'll probably defer it. |