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

Silence tst_moc warnings

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • None
    • Build tools: moc
    • None

    Description

      Compiling tst_moc always throws some moc warnings because we test some stuff. Consider porting those tests that cause moc to warn to the framework since developed in tst_moc whereby the test itself runs moc and scans the output for expected warnings.

      That will help keep the build clean.

      Example output:

      [2037/5626] Automatic MOC for target tst_moc
      AutoMoc: /home/marc/Qt/qtbase-submit/tests/auto/tools/moc/tst_moc.cpp:1900:1: warning: Property declaration dummy has neither an associated QProperty<> member, nor a READ accessor function nor an associated MEMBER variable. The property will be invalid.
      [2081/5626] Generating moc_pure-virtual-signals.cpp
      /home/marc/Qt/qtbase-submit/tests/auto/tools/moc/pure-virtual-signals.h:13:1: warning: Signals cannot be declared virtual
      /home/marc/Qt/qtbase-submit/tests/auto/tools/moc/pure-virtual-signals.h:15:1: warning: Signals cannot be declared virtual
      [2093/5626] Generating moc_using-namespaces.cpp
      /home/marc/Qt/qtbase-submit/tests/auto/tools/moc/using-namespaces.h: note: No relevant classes found. No output generated.
      [2109/5626] Building CXX object tests/auto/tools/moc/CMakeFiles/tst_moc.dir/moc_backslash-newlines.cpp.o
      In file included from /home/marc/Qt/qtbase-submit-build-2/tests/auto/tools/moc/moc_backslash-newlines.cpp:9:
      /home/marc/Qt/qtbase-submit-build-2/tests/auto/tools/moc/../../../../../qtbase-submit/tests/auto/tools/moc/backslash-newlines.h:35:1: warning: multi-line comment [-Wcomment]
         35 | // ends with \\\r should not make moc crash (QTBUG-53441) (no new lines on purpose!!) \
            | ^
      [2322/5626] Building CXX object tests/auto/tools/moc/CMakeFiles/tst_moc.dir/tst_moc.cpp.o
      In file included from /home/marc/Qt/qtbase-submit/tests/auto/tools/moc/tst_moc.cpp:20:
      /home/marc/Qt/qtbase-submit/tests/auto/tools/moc/backslash-newlines.h:35:1: warning: multi-line comment [-Wcomment]
         35 | // ends with \\\r should not make moc crash (QTBUG-53441) (no new lines on purpose!!) \
            | ^
      In file included from /home/marc/Qt/qtbase-submit/tests/auto/tools/moc/tst_moc.cpp:19:
      /home/marc/Qt/qtbase-submit/tests/auto/tools/moc/single_function_keyword.h:27:26: warning: inline function ‘void SingleFunctionKeywordBeforeInline::mySignal()’ used but never defined
         27 |     Q_SIGNAL inline void mySignal();
            |                          ^~~~~~~~
      /home/marc/Qt/qtbase-submit/tests/auto/tools/moc/single_function_keyword.h:41:26: warning: inline function ‘void SingleFunctionKeywordAfterInline::mySignal()’ used but never defined
         41 |     inline Q_SIGNAL void mySignal();
            |                          ^~~~~~~~
      

      Attachments

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

        Activity

          People

            fabiankosmale Fabian Kosmale
            mmutz Marc Mutz
            Vladimir Minenko Vladimir Minenko
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes