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

Code generated by qtwaylandscanner doesn't compile with old-style-cast Werror

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 6.7.1
    • Wayland Compositor
    • None
    • Linux/Wayland

      If stricter compiler options are used, qtwaylandscanner generated code might not compile any more. E.g. if the following is applied to QtWayland auto-tests:

      diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt
      index 5c1cd7c5..751d7dcd 100644
      --- a/tests/auto/CMakeLists.txt
      +++ b/tests/auto/CMakeLists.txt
      @@ -3,6 +3,10 @@
       
       # Generated from auto.pro.
       
      +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
      +    add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-Werror=old-style-cast;-Werror=sign-conversion>")
      +endif()
      +
       if(TARGET Qt::WaylandClient)
           add_subdirectory(client)
       endif()
      

      the tests won't compile any more (with gcc). Some customers might have stricter setups for various reasons. There's room for improvement at least.

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

            qt.team.graphics.and.multimedia Qt Graphics Team
            bweimer Bernd Weimer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes