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

Qt Test: percent sign character in build dir path causes build error "cl : Command line error D8038"

    XMLWordPrintable

    Details

      Description

      Test library seems to add a definition QT_TESTCASE_BUILDDIR using compiler option -D and the value is the path to the build directory. However, if there are any percent sign characters in the path those get passed unmodified directly to the compiler potentially causing the build to fail with an error:

      cl : Command line error D8038 : invalid argument 'QT_TESTCASE_BUILDDIR="C:/test_dir/foo%2bar/build"'
      

      According to MS docs at https://docs.microsoft.com/en-us/cpp/build/reference/d-preprocessor-definitions?view=msvc-160#remarks percent sign should be written as %% when passing it to the compiler with -D.

      Steps to reproduce the problem:

      • Build the attached project in a directory called "foo%2bar"

        Attachments

        1. build_log.txt
          2 kB
        2. qtbug98103.zip
          0.7 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            jbornema Joerg Bornemann
            Reporter:
            miikapernu Miika Pernu
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes