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

Extra arguments are implicitly carried forward to functions

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.6.2
    • 5.3.1
    • Build tools: qmake
    • None
    • Used qmake 3.0
    • dacf3994ba29106132c3a377dba303acdb74daca

    Description

      If a qmake function can receive multiple arguments and they are not all specified by the caller, but have been specified for the previous function, they are carried forward to the function.

      The workaround is to explicitly leave them empty.

      I don't know if this is by design, but it's a little unintuitive and can cause some surprises.

      Example ".pro" file:

      defineTest(optionalSecondArgumentFunction) {
      
        !isEmpty(2) : error("Received second argument: $$2");
      
        warning("No second argument")
      
      }
      
      
      defineTest(anotherTwoArgumentFunction) {
      
        optionalSecondArgumentFunction(goodbye, )   # explicit empty second arg
      
        optionalSecondArgumentFunction(goodbye)
      
      }
      
      
      anotherTwoArgumentFunction(hello, world)
      

      Attachments

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

        Activity

          People

            buddenha Oswald Buddenhagen
            chard Richard Hazlewood
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes