System function '$sformatf' is invoked as task, its return value is discarded

Hello, I have a driver code as follows:


class my_driver;
   // code
   virtual task run();
   forever begin
        // code
        $sformatf("<print something>", <variables>);
   end
  endtask
endclass


I get the warning

System function '$sformatf' is invoked as task, its return value is    discarded.

I don’t understand why I get this warning as I am using

$sformatf

and not

$sformat

In reply to vk7715:

The system function $sformatf behaves like $sformat except that the string result is passed back as the function result value for $sformatf, not placed in the first argument as for $sformat. Thus $sformatf can be used where a string value would be valid.