In C, if you have a function that returns "always" the same result you can do:
(gdb) p foo()
But if this function always returns a random result, how to print THAT value without use a variable. Other detail, if you don't have debug information of the function, it's from a stripped lib.
(gdb) p myRandom()
can't be used, it will result in something different than the value used by application.
You may ask: "Why would you use a random function and don't use its results", lets say that the return is just an extra thing of what that func does.