Please consider the attached chunk of code (inside tar.gz archive).
Here, a function TQStringUtils::format is defined, which is pretty much an exact copy of TString::Format.
Internally, a variadic function TQStringUtils::vaFormat is called, which is in turn a copy of the private TString::FormImp function.
Both functions work perfectly when compiled with g++, but the variadic argument passing is messed up when run in interpreted mode. It seems like the variadic argument lists starts off one entry too early in the interpreted mode, with the first argument in the list being the last named argument of the function call.
However, I do not know why this is the case or how this problem can be fixed.
To observe the behaviour, download the attached .tar.gz file, extract it to some folder, type “make” and “make run”.
stringutilstest.tar.gz (2.01 KB)