
0
[W521] false positive when SetString is used
The following code produces a W521: Return value of function xxx might be undefined:
function GetModuleFilename(const _Module: Cardinal): string;
var
Buffer: array[0..260] of Char;
begin
SetString(Result, Buffer, Windows.GetModuleFilename(_Module, Buffer, SizeOf(Buffer)))
end;
It should not.
Customer support service by UserEcho
I think this is a duplicate of: http://fixinsight.userecho.com/topics/68-w521-false-positive-when-result-is-set-in-a-function-call/, maybe related to: http://fixinsight.userecho.com/topics/74-w521-false-positive-with-result/