Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-44856

Turn on -Wunused-exception-parameter for clang builds

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.3.3
    • Affects Version/s: None
    • Component/s: Build
    • Labels:
      None
    • Fully Compatible
    • Dev Platform 2019-12-16

      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

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            matthew.russotto@mongodb.com Matthew Russotto
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: