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

Extra arguments are implicitly carried forward to functions

XMLWordPrintable

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

      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)
      

        For Gerrit Dashboard: QTBUG-41830
        # Subject Branch Project Status CR V

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes