Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-82978

Allow "-Wextra-semi-stmt" on Q_UNUSED

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.14.1, 5.15.0, 6.0.0
    • Fix Version/s: None
    • Component/s: Build tools: moc
    • Labels:
      None

      Description

      I like to use "-Wextra-semi-stmt" in my application code. But the moc adds some Q_UNUSED with and without a semicolon. It would be helpful to unify this.

      I tried to change this but it seems that Qt6 should switch the ; behaviour in user code.

      https://codereview.qt-project.org/c/qt/qtbase/+/258285

      Mårten Nordheim

      Patch Set 1:

      The consensus I've seen is that uses should have the semicolon, and Q_UNUSED should lose its semicolon (Qt6?)

      Thiago Macieira Code-Review +1

      Patch Set 1: Code-Review+1

      I'd rather we changed the macro not to add it, but that's source incompatible.

      change the macro would also be nice to let the user add the ; as it is confusing for a developer and the code formatter.

        Attachments

          Issue Links

          For Gerrit Dashboard: QTBUG-82978
          # Subject Branch Project Status CR V

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              misery André Klitzing
              Votes:
              1 Vote for this issue
              Watchers:
              10 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are 4 open Gerrit changes