mirror of
https://github.com/winscp/winscp.git
synced 2026-10-24 02:28:55 +03:00
Clang incorrectly warns about some variables being unintialized, while the classic compiler warns that the value is never used
Source commit: 85cc13e319936e7644a5adde71d09623113e9176
This commit is contained in:
@@ -3920,7 +3920,7 @@ UnicodeString __fastcall RtfEscapeParam(UnicodeString Param, bool PowerShellEsca
|
||||
else
|
||||
{
|
||||
int P2 = PosEx(RtfHyperlinkFieldPrefix, Param, Index);
|
||||
int P3 = 0; // shut up
|
||||
int P3 CLANG_INITIALIZE(0);
|
||||
if ((P2 > 0) && (P2 < P1) && ((P3 = PosEx(RtfHyperlinkFieldSuffix, Param, P2)) > 0))
|
||||
{
|
||||
// skip HYPERLINK
|
||||
|
||||
@@ -4043,7 +4043,7 @@ UnicodeString __fastcall FormatValidityTime(const TFtpsCertificateData::TValidit
|
||||
bool __fastcall VerifyNameMask(UnicodeString Name, UnicodeString Mask)
|
||||
{
|
||||
bool Result = true;
|
||||
int Pos = 0; // shut up
|
||||
int Pos CLANG_INITIALIZE(0);
|
||||
while (Result && (Pos = Mask.Pos(L"*")) > 0)
|
||||
{
|
||||
// Pos will typically be 1 here, so not actual comparison is done
|
||||
|
||||
@@ -34,6 +34,12 @@ private:
|
||||
TCriticalSection * FCriticalSection;
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
#ifdef __clang__
|
||||
#define CLANG_INITIALIZE(V) = (V)
|
||||
#else
|
||||
#define CLANG_INITIALIZE(V)
|
||||
#endif
|
||||
//---------------------------------------------------------------------------
|
||||
//---------------------------------------------------------------------------
|
||||
#include <assert.h>
|
||||
#define ACCESS_VIOLATION_TEST { (*((int*)NULL)) = 0; }
|
||||
|
||||
@@ -52,7 +52,7 @@ void __fastcall TNamedObject::MakeUniqueIn(TNamedObjectList * List)
|
||||
if (List && (List->IndexOf(this) == -1))
|
||||
while (List->FindByName(Name))
|
||||
{
|
||||
Integer N = 0, P = 0; // shut up
|
||||
Integer N = 0, P CLANG_INITIALIZE(0);
|
||||
// If name already contains number parenthesis remove it (and remember it)
|
||||
if ((Name[Name.Length()] == L')') && ((P = Name.LastDelimiter(L'(')) > 0))
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user