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

Allow "-Wextra-semi-stmt" on Q_UNUSED

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • None
    • 5.14.1, 5.15.0, 6.0.0
    • Build tools: moc
    • None
    • 71223cc92ba1039f0dfde1bb30d3cccdab30c4dd (qt/qtbase/dev) 2efc1cd6aa2f9a4797ba22fcde8acf1fa7e777d1 (qt/qtbase/5.15)

      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.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Unassigned Unassigned
            misery André Klitzing
            Votes:
            1 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes