From 1d9fe8c95542523c78f5cc2bbcd96a344b6ff811 Mon Sep 17 00:00:00 2001 From: Martin Prikryl Date: Thu, 4 Sep 2025 04:53:51 +0000 Subject: [PATCH] Changing compiler to Clang/bcc32c - regarding the ILINK_LibraryPath for Cfg_1_Win32 (Debug): Win32\Debug (not only Win32c\Debug) needs to be before Win32c\Release, as win32c does not include debug builds of Pascal code - so without that VCL debugging won't work - IDE insist on adding CC_Suffix to all projects once switched to Clang, although it is only used in WinSCP.cbproj - UNICODE define: Not needed for build (it's implicit), but CodeInsight does not know it it somehow Source commit: da06d73eb86caff5ca9cac0185bed54da0da8f07 --- libs/Makefile.inc | 14 ++++++++------ libs/expat/bcb5/expat_static.mak | 3 +-- libs/expat/lib/winconfig.h | 1 - libs/libs3/Makefile | 2 +- libs/mfc/source/borland.mak | 6 +++--- libs/neon/Makefile.bcb | 2 +- libs/neon/src/ne_socket.h | 3 +++ libs/openssl/Makefile | 2 +- source/Console.cbproj | 1 + source/DScpComp.cbproj | 3 +++ source/DragDropP.cbproj | 2 ++ source/DragExt.cbproj | 1 + source/DriveDir.cbproj | 6 ++---- source/FileZilla.cbproj | 20 +++++++++----------- source/Jcl.cbproj | 3 ++- source/My.cbproj | 2 ++ source/PngComponents.cbproj | 3 ++- source/Putty.cbproj | 27 +++------------------------ source/RScpComp.cbproj | 5 ++++- source/ScpCore.cbproj | 11 +++++++++-- source/ScpForms.cbproj | 10 +++++++++- source/ScpResources.cbproj | 9 +++++++++ source/WinSCP.cbproj | 16 ++++++++++++---- source/core/Common.cpp | 3 +++ source/core/Configuration.cpp | 3 +++ source/core/Cryptography.cpp | 3 +++ source/core/FileOperationProgress.h | 1 + source/core/Global.h | 3 ++- source/core/Http.cpp | 3 +++ source/core/Interface.h | 2 ++ source/core/NeonIntf.cpp | 3 +++ source/core/PuttyIntf.cpp | 3 +++ source/core/PuttyIntf.h | 6 ++++++ source/core/Queue.cpp | 2 +- source/core/RemoteFiles.h | 2 ++ source/core/S3FileSystem.h | 3 +++ source/core/SecureShell.cpp | 2 +- source/core/SessionInfo.h | 1 + source/core/Terminal.cpp | 3 +++ source/filezilla/FilezillaTools.h | 3 +++ source/tb2k.cbproj | 2 ++ source/tbxp.cbproj | 2 ++ source/windows/GUITools.cpp | 5 +++-- source/windows/GUITools.h | 6 ++++++ source/windows/WinConfiguration.h | 1 + source/windows/WinInterface.cpp | 5 +++++ 46 files changed, 150 insertions(+), 69 deletions(-) diff --git a/libs/Makefile.inc b/libs/Makefile.inc index 764f667c1..f4be1fa22 100644 --- a/libs/Makefile.inc +++ b/libs/Makefile.inc @@ -1,7 +1,9 @@ -CC = "$(BDS)\bin\bcc32" +CC = "$(BDS)\bin\bcc32c" MKLIB = "$(BDS)\bin\tlib" /a /C -CFLAG_BASE=-O2 -c -fp -tWM -# These are defaults anyway -CFLAG_BASE=$(CFLAG_BASE) -a8 -vi -ff -CFLAG_COMMON=$(CFLAG_BASE) -CFLAG_CPP=$(CFLAG_BASE) /P \ No newline at end of file +CFLAG_BASE = -cc1 -nobuiltininc -nostdsysteminc -triple i686-pc-windows-omf -emit-obj -mrelocation-model static -masm-verbose -mstack-alignment=16 -O2 -tM -tW -fborland-extensions +CFLAG_BASE = $(CFLAG_BASE) -isystem "$(BDS)/include/windows/crtl" -isystem "$(BDS)/include/windows/sdk" -isystem "$(BDS)/include/dinkumware64" +CFLAG_COMMON = $(CFLAG_BASE) -std=c99 -x c -fno-threadsafe-statics +CFLAG_CPP = $(CFLAG_BASE) -x c++ -std=c++17 -fcxx-exceptions -ffunction-sections -fno-use-cxa-atexit + +# Debug: +# CFLAG_CPP=$(CFLAG_CPP) -D_DEBUG -debug-info-kind=standalone diff --git a/libs/expat/bcb5/expat_static.mak b/libs/expat/bcb5/expat_static.mak index fbfb375fd..63d40991b 100644 --- a/libs/expat/bcb5/expat_static.mak +++ b/libs/expat/bcb5/expat_static.mak @@ -11,7 +11,6 @@ OBJFILES = \ # --------------------------------------------------------------------------- DEFINES = _WINDOWS;WIN32;NDEBUG;_LIB;XML_STATIC;WINSCP;_NO_VCL;_ASSERTE;NO_STRICT;_RTLDLL INCLUDEPATH = ..;..\lib -WARNINGS = -w-rch -w-par -w-8027 -w-8026 -w-ccc -w-8012 CFLAG1 = $(CFLAG_COMMON) # --------------------------------------------------------------------------- .autodepend @@ -23,5 +22,5 @@ $(PROJECT): $(OBJFILES) # --------------------------------------------------------------------------- .path.c = ..\lib .c.obj: - $(CC) $(CFLAG1) $(WARNINGS) -I$(INCLUDEPATH:;= -I) $(DEFINESARGS) -o $@ $< + $(CC) $(CFLAG1) -I$(INCLUDEPATH:;= -I) $(DEFINESARGS) -o $@ $< # --------------------------------------------------------------------------- diff --git a/libs/expat/lib/winconfig.h b/libs/expat/lib/winconfig.h index 0ea624af0..311b08e9d 100644 --- a/libs/expat/lib/winconfig.h +++ b/libs/expat/lib/winconfig.h @@ -45,6 +45,5 @@ #include #include #include -#define isnan _isnan #endif /* ndef WINCONFIG_H */ diff --git a/libs/libs3/Makefile b/libs/libs3/Makefile index b8de7bece..298ac5fd0 100644 --- a/libs/libs3/Makefile +++ b/libs/libs3/Makefile @@ -2,7 +2,7 @@ # Set your compiler options DEFINES = WIN32;WIN32_LEAN_AND_MEAN;WINSCP;NE_LFS -WARNINGS = -w-aus -w-par +WARNINGS = -Wno-deprecated-declarations # Compile like C++ CFLAG = $(CFLAG_CPP) -D$(DEFINES:;= -D) $(WARNINGS) # The output directory for all the temporary muck diff --git a/libs/mfc/source/borland.mak b/libs/mfc/source/borland.mak index bedbcd410..594aec1fa 100644 --- a/libs/mfc/source/borland.mak +++ b/libs/mfc/source/borland.mak @@ -17,8 +17,8 @@ GOAL=$(MODEL)afxc$(BASE) # # COMPILER OPTIONS # -# -VF4 Support MFC 4.0 -CL_OPT=-VF4 -w- +WARNINGS=-Wno-extra-tokens -Wno-extern-initializer -Wno-varargs +CL_OPT=$(WARNINGS) ############################################################################# # Library Components @@ -43,7 +43,7 @@ OBJS=$(CPP_OBJS) CPPFLAGS=$(CFLAG_CPP) $(CL_OPT) -D$(DEFS:;= -D) -BORFLAGS=$(CPPFLAGS) -I$(INCL:;= -I) +BORFLAGS=$(CPPFLAGS) -I$(INCL:;= -I) -isystem "$(BDS)/include/windows/rtl" .SUFFIXES: .cpp diff --git a/libs/neon/Makefile.bcb b/libs/neon/Makefile.bcb index 15c5720fa..3776b48cc 100644 --- a/libs/neon/Makefile.bcb +++ b/libs/neon/Makefile.bcb @@ -5,7 +5,7 @@ OPENSSL_DEFINES=OPENSSL_SYSNAME_WIN32;L_ENDIAN;DSO_WIN32;BN_ASM;MD5_ASM;SHA1_ASM EXPAT_DEFINES=COMPILED_FROM_DSP;XML_STATIC DEFINES=WIN32;WIN32_LEAN_AND_MEAN;_WINDOWS;WIN32;NDEBUG;_LIB;_NO_VCL;_ASSERTE;NO_STRICT;_RTLDLL;NE_HAVE_SSL;HAVE_OPENSSL;HAVE_EXPAT;HAVE_EXPAT_H;NE_HAVE_DAV;NE_LFS;NOUSER;NOGDI;HAVE_STRTOLL;WINSCP ALLDEFINES=$(OPENSSL_DEFINES);$(EXPAT_DEFINES);$(DEFINES) -WARNINGS=-w-ccc -w-rch -w-pia -w-aus -w-par -w-inl -w-eff -w-sus -w-dup -w-spa -w-csu -w-rvl -w-8065 -w-8069 +WARNINGS=-Wno-typedef-redefinition -Wno-incompatible-pointer-types CFLAG=$(CFLAG_COMMON) $(WARNINGS) # neon directory diff --git a/libs/neon/src/ne_socket.h b/libs/neon/src/ne_socket.h index d6a631bef..c98e4784b 100644 --- a/libs/neon/src/ne_socket.h +++ b/libs/neon/src/ne_socket.h @@ -343,7 +343,10 @@ int ne_sock_proxy(ne_socket *sock, enum ne_sock_sversion vers, // WINSCP void ne_sock_set_buffers(ne_socket *sock, unsigned int sndbuf); +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreserved-id-macro" #include +#pragma clang diagnostic pop void ne_init_ssl_session(SSL *ssl, void *userdata); int ne_sock_sspi_init(void); diff --git a/libs/openssl/Makefile b/libs/openssl/Makefile index a4a5652ae..f6e5db6d5 100644 --- a/libs/openssl/Makefile +++ b/libs/openssl/Makefile @@ -17,7 +17,7 @@ # Set your compiler options -CFLAG_WARNINGS=-w-ccc -w-rch -w-pia -w-aus -w-par -w-inl -w-eff -w-sus -w-dup -w-spa -w-csu -w-rvl +CFLAG_WARNINGS=-Wno-incompatible-function-pointer-types -Wno-deprecated-declarations CFLAG=$(CFLAG_COMMON) $(CFLAG_WARNINGS) DEFINES=MD5_ASM;SHA1_ASM;SHA256_ASM;SHA512_ASM;RMD160_ASM diff --git a/source/Console.cbproj b/source/Console.cbproj index fb65bb3db..8e8cfe1e1 100644 --- a/source/Console.cbproj +++ b/source/Console.cbproj @@ -8,6 +8,7 @@ Win32 1 Console + c true diff --git a/source/DScpComp.cbproj b/source/DScpComp.cbproj index c3ae285b7..9d3a1e7e9 100644 --- a/source/DScpComp.cbproj +++ b/source/DScpComp.cbproj @@ -9,6 +9,7 @@ Win32 1 Package + c true @@ -46,6 +47,8 @@ true true true + false + -Wno-ignored-attributes -Wno-zero-as-null-pointer-constant -Wno-c++98-compat-pedantic -Wno-language-extension-token -Wno-missing-prototypes -Wno-old-style-cast -Wno-padded $(INTERM_PATH)\$(Platform)\$(Config) JPHNE Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Vcl;$(DCC_Namespace) diff --git a/source/DragDropP.cbproj b/source/DragDropP.cbproj index df1d80183..795aee465 100644 --- a/source/DragDropP.cbproj +++ b/source/DragDropP.cbproj @@ -9,6 +9,7 @@ Win32 1 Package + c true @@ -32,6 +33,7 @@ <_TCHARMapping>wchar_t true true + false $(INTERM_PATH)\$(Platform)\$(Config) JPHNE true diff --git a/source/DragExt.cbproj b/source/DragExt.cbproj index 3689b17a6..2b9675966 100644 --- a/source/DragExt.cbproj +++ b/source/DragExt.cbproj @@ -8,6 +8,7 @@ Win32 3 Library + c true diff --git a/source/DriveDir.cbproj b/source/DriveDir.cbproj index 2e4e5d961..7c939fa1a 100644 --- a/source/DriveDir.cbproj +++ b/source/DriveDir.cbproj @@ -9,6 +9,7 @@ Win32 1 Package + c true @@ -32,6 +33,7 @@ <_TCHARMapping>wchar_t true true + false $(INTERM_PATH)\$(Platform)\$(Config) JPHNE true @@ -150,10 +152,6 @@ 26 true - - 68 - 12 - 25 diff --git a/source/FileZilla.cbproj b/source/FileZilla.cbproj index b34ffced5..4e9ee6343 100644 --- a/source/FileZilla.cbproj +++ b/source/FileZilla.cbproj @@ -8,6 +8,7 @@ Win32 1 StaticLibrary + c true @@ -31,19 +32,12 @@ <_TCHARMapping>wchar_t true true - false - false - false - false - false - false - false - false - false - false + filezilla\FileZillaPCH.h + false + -Wno-ignored-attributes -Wno-dangling-else -Wno-extra-tokens JPHNE System;Xml;Data;Datasnap;Web;Soap;Vcl;$(DCC_Namespace) - WINSCP;WIN32;$(Defines) + WINSCP;WIN32;UNICODE;$(Defines) $(INTERM_PATH)\$(Platform)\$(Config) $(BDS)\lib;$(BDS)\lib\obj;$(BDS)\lib\psdk;$(ILINK_LibraryPath) filezilla\misc\;filezilla\;resource;core;..\libs\openssl\include;..\libs\mfc\include;$(BDS)\include;$(BDS)\include\windows\vcl;$(IncludePath) @@ -145,6 +139,10 @@ Cfg_2 Base + + 16 + true + diff --git a/source/Jcl.cbproj b/source/Jcl.cbproj index 8bdb241f5..940b37db1 100644 --- a/source/Jcl.cbproj +++ b/source/Jcl.cbproj @@ -9,6 +9,7 @@ Win32 1 Package + c true @@ -37,7 +38,7 @@ <_TCHARMapping>char true true - false + false $(INTERM_PATH)\$(Platform)\$(Config) JPHNE System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) diff --git a/source/My.cbproj b/source/My.cbproj index 7bd0691d3..82c699618 100644 --- a/source/My.cbproj +++ b/source/My.cbproj @@ -9,6 +9,7 @@ Win32 1 Package + c true @@ -32,6 +33,7 @@ <_TCHARMapping>wchar_t true true + false $(INTERM_PATH)\$(Platform)\$(Config) JPHNE true diff --git a/source/PngComponents.cbproj b/source/PngComponents.cbproj index eba1180d7..3f3736412 100644 --- a/source/PngComponents.cbproj +++ b/source/PngComponents.cbproj @@ -9,6 +9,7 @@ Win32 1 Package + c true @@ -37,7 +38,7 @@ <_TCHARMapping>char true true - false + false $(INTERM_PATH)\$(Platform)\$(Config) -LUDesignIDE JPHNE diff --git a/source/Putty.cbproj b/source/Putty.cbproj index 44137d91e..ba37f843d 100644 --- a/source/Putty.cbproj +++ b/source/Putty.cbproj @@ -8,6 +8,7 @@ Win32 1 StaticLibrary + c true @@ -31,30 +32,8 @@ rtl.lib true true - true - true - true - false - false - false - true - false - true - false - true - true - true - true - true - true - false - false - false - false - false - true - true - false + false + -Wno-typedef-redefinition JPHNE System;Xml;Data;Datasnap;Web;Soap;Vcl;$(DCC_Namespace) SECURITY_WIN32;WINSCP;MPEXT;PLATFORM_HAS_SMEMCLR;_WINDOWS;$(Defines) diff --git a/source/RScpComp.cbproj b/source/RScpComp.cbproj index 6c564b428..f8d319647 100644 --- a/source/RScpComp.cbproj +++ b/source/RScpComp.cbproj @@ -8,6 +8,7 @@ Win32 1 StaticLibrary + c true @@ -33,9 +34,11 @@ true true true - false + false + -Wno-ignored-attributes -Wno-zero-as-null-pointer-constant -Wno-c++98-compat-pedantic -Wno-language-extension-token -Wno-missing-prototypes -Wno-old-style-cast -Wno-padded -Wno-float-equal JPHNE System;Xml;Data;Datasnap;Web;Soap;Vcl;$(DCC_Namespace) + UNICODE;$(Defines) $(INTERM_PATH)\$(Platform)\$(Config) $(BDS)\lib;$(ILINK_LibraryPath) components\;core;windows;packages\filemng;packages\dragndrop;packages\my;packages\tb2k;packages\tbx;$(BDS)\include;$(BDS)\include\windows\vcl;$(IncludePath) diff --git a/source/ScpCore.cbproj b/source/ScpCore.cbproj index 7a3358e6d..686a88626 100644 --- a/source/ScpCore.cbproj +++ b/source/ScpCore.cbproj @@ -8,6 +8,7 @@ Win32 1 StaticLibrary + c true @@ -33,10 +34,12 @@ true true true - false + core\CorePCH.h + false + -Wno-objc-interface-ivars -Wno-return-type-c-linkage -Wno-covered-switch-default -Wno-cast-align -Wno-implicit-fallthrough -Wno-missing-prototypes -Wno-switch -Wno-shadow -Wno-sign-conversion -Wno-global-constructors -Wno-exit-time-destructors -Wno-padded -Wno-c++98-compat-pedantic -Wno-zero-as-null-pointer-constant -Wno-language-extension-token -Wno-old-style-cast -Wno-ignored-attributes -Wno-float-equal -Wno-switch-enum JPHNE System;Xml;Data;Datasnap;Web;Soap;Vcl;$(DCC_Namespace) - WINSCP;_WINDOWS;WIN32;WINNT;OPENSSL_NO_DEPRECATED_1_1_0;_CRTIMP=;_LIB;$(BUILD_TYPE);$(Defines) + WINSCP;_WINDOWS;WIN32;WINNT;OPENSSL_NO_DEPRECATED_1_1_0;_CRTIMP=;_LIB;UNICODE;$(BUILD_TYPE);$(Defines) $(INTERM_PATH)\$(Platform)\$(Config) $(BDS)\lib;$(ILINK_LibraryPath) core\;putty;putty\windows;filezilla;resource;..\libs\openssl\include;..\libs\expat\lib;..\libs\neon\src;..\libs\libs3\inc;..\libs\mfc\include;$(BDS)\include;$(BDS)\include\windows\vcl;$(IncludePath) @@ -217,6 +220,10 @@ Cfg_2 Base + + 33 + true + diff --git a/source/ScpForms.cbproj b/source/ScpForms.cbproj index 9e6aeabc5..ca6d6f2e5 100644 --- a/source/ScpForms.cbproj +++ b/source/ScpForms.cbproj @@ -8,6 +8,7 @@ Win32 1 StaticLibrary + c true @@ -28,9 +29,12 @@ true true true - false + forms\FormsPCH.h + false + -Wno-objc-interface-ivars -Wno-return-type-c-linkage -Wno-covered-switch-default -Wno-cast-align -Wno-implicit-fallthrough -Wno-missing-prototypes -Wno-switch -Wno-shadow -Wno-sign-conversion -Wno-global-constructors -Wno-exit-time-destructors -Wno-padded -Wno-c++98-compat-pedantic -Wno-zero-as-null-pointer-constant -Wno-language-extension-token -Wno-old-style-cast -Wno-ignored-attributes -Wno-float-equal -Wno-switch-enum JPHNE System;Xml;Data;Datasnap;Web;Soap;Vcl;$(DCC_Namespace) + UNICODE;$(Defines) $(INTERM_PATH)\$(Platform)\$(Config) windows\;forms\;core;components;resource;packages\filemng;packages\dragndrop;packages\my;packages\tb2k;packages\tbx;packages\png;packages\jcl;$(BDS)\include\windows;$(BDS)\include\windows\vcl;$(IncludePath) $(INTERM_PATH)\$(Platform)\$(Config) @@ -341,6 +345,10 @@ Cfg_2 Base + + 38 + true + diff --git a/source/ScpResources.cbproj b/source/ScpResources.cbproj index ff9c0f535..09319ba4d 100644 --- a/source/ScpResources.cbproj +++ b/source/ScpResources.cbproj @@ -8,6 +8,7 @@ Win32 1 StaticLibrary + c true @@ -27,8 +28,12 @@ true true true + forms\ResourcesPCH.h + false + -Wno-objc-interface-ivars -Wno-return-type-c-linkage -Wno-covered-switch-default -Wno-cast-align -Wno-implicit-fallthrough -Wno-missing-prototypes -Wno-switch -Wno-shadow -Wno-sign-conversion -Wno-global-constructors -Wno-exit-time-destructors -Wno-padded -Wno-c++98-compat-pedantic -Wno-zero-as-null-pointer-constant -Wno-language-extension-token -Wno-old-style-cast -Wno-ignored-attributes -Wno-float-equal -Wno-switch-enum JPHNE System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) + UNICODE;$(Defines) $(INTERM_PATH)\$(Platform)\$(Config) core\;forms\;windows\;packages\my;packages\png;packages\tb2k;packages\tbx;$(BDS)\include\windows;$(BDS)\include\windows\vcl;$(IncludePath) $(INTERM_PATH)\$(Platform)\$(Config) @@ -138,6 +143,10 @@ Cfg_2 Base + + 8 + true + diff --git a/source/WinSCP.cbproj b/source/WinSCP.cbproj index 21c5eb45d..72b3c3d17 100644 --- a/source/WinSCP.cbproj +++ b/source/WinSCP.cbproj @@ -9,6 +9,7 @@ Win32 1 Application + c true @@ -53,14 +54,16 @@ true true true - false + windows\WinPCH.h + false + -Wno-objc-interface-ivars -Wno-return-type-c-linkage -Wno-covered-switch-default -Wno-cast-align -Wno-implicit-fallthrough -Wno-missing-prototypes -Wno-switch -Wno-shadow -Wno-sign-conversion -Wno-global-constructors -Wno-exit-time-destructors -Wno-padded -Wno-c++98-compat-pedantic -Wno-zero-as-null-pointer-constant -Wno-language-extension-token -Wno-old-style-cast -Wno-ignored-attributes -Wno-float-equal -Wno-switch-enum 65001 JPHNE Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Vcl;$(DCC_Namespace) false false false - WINSCP;STRICT;$(Defines) + WINSCP;STRICT;UNICODE;$(Defines) $(FINAL_PATH)\$(Platform)\$(Config) resource\Application.ico True @@ -92,6 +95,7 @@ true true None + Debug true true DEBUG @@ -104,7 +108,7 @@ true - $(INTERM_PATH)\Win32\Debug\;$(INTERM_PATH)\Win32\;$(BDS)\lib\Win32\Debug\;$(BDS)\lib\Win32\Release\;$(BDS)\lib\Win32\Release\psdk\;$(ILINK_LibraryPath) + $(INTERM_PATH)\Win32\Debug\;$(INTERM_PATH)\Win32\;$(BDS)\lib\Win32$(CC_Suffix)\Debug\;$(BDS)\lib\Win32\Debug\;$(BDS)\lib\Win32$(CC_Suffix)\Release\;$(BDS)\lib\Win32$(CC_Suffix)\Release\psdk\;$(ILINK_LibraryPath) $(INTERM_PATH)\Win64\Debug\;$(INTERM_PATH)\Win64\;$(BDS)\lib\Win64\Debug\;$(BDS)\lib\Win64\Release\;$(BDS)\lib\Win64\Release\psdk\;$(ILINK_LibraryPath) @@ -114,7 +118,7 @@ None - $(INTERM_PATH)\Win32\Release\;$(INTERM_PATH)\Win32\;$(BDS)\lib\Win32\Release\;$(BDS)\lib\Win32\Release\psdk\;$(ILINK_LibraryPath) + $(INTERM_PATH)\Win32\Release\;$(INTERM_PATH)\Win32\;$(BDS)\lib\Win32$(CC_Suffix)\Release\;$(BDS)\lib\Win32$(CC_Suffix)\Release\psdk\;$(ILINK_LibraryPath) $(INTERM_PATH)\Win64\Release\;$(INTERM_PATH)\Win64\;$(BDS)\lib\Win64\Release\;$(BDS)\lib\Win64\Release\psdk\;$(ILINK_LibraryPath) @@ -280,6 +284,10 @@ Cfg_2 Base + + 35 + true + diff --git a/source/core/Common.cpp b/source/core/Common.cpp index 639d3b3fc..e8e9e9324 100644 --- a/source/core/Common.cpp +++ b/source/core/Common.cpp @@ -10,10 +10,13 @@ #include #include #include +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreserved-id-macro" #include #include #include #include +#pragma clang diagnostic pop //--------------------------------------------------------------------------- const wchar_t * DSTModeNames = L"Win;Unix;Keep"; //--------------------------------------------------------------------------- diff --git a/source/core/Configuration.cpp b/source/core/Configuration.cpp index a27815252..1703f6427 100644 --- a/source/core/Configuration.cpp +++ b/source/core/Configuration.cpp @@ -1181,7 +1181,10 @@ bool __fastcall TConfiguration::GetIsUnofficial() //--------------------------------------------------------------------------- static TDateTime GetBuildDate() { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdate-time" UnicodeString BuildDateStr = __DATE__; +#pragma clang diagnostic pop UnicodeString MonthStr = CutToChar(BuildDateStr, L' ', true); int Month = ParseShortEngMonthName(MonthStr); int Day = StrToInt(CutToChar(BuildDateStr, L' ', true)); diff --git a/source/core/Cryptography.cpp b/source/core/Cryptography.cpp index 598462223..4df4e8f1a 100644 --- a/source/core/Cryptography.cpp +++ b/source/core/Cryptography.cpp @@ -6,9 +6,12 @@ #include "Cryptography.h" #include "FileBuffer.h" #include "Exceptions.h" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreserved-id-macro" #include #include #include +#pragma clang diagnostic pop #include #include diff --git a/source/core/FileOperationProgress.h b/source/core/FileOperationProgress.h index 6f20881e7..3a7287e55 100644 --- a/source/core/FileOperationProgress.h +++ b/source/core/FileOperationProgress.h @@ -168,6 +168,7 @@ public: TFileOperationProgressEvent AOnProgress, TFileOperationFinished AOnFinished, TFileOperationProgressType * Parent = NULL); __fastcall ~TFileOperationProgressType(); + TFileOperationProgressType & operator =(const TFileOperationProgressType &) = default; void __fastcall Assign(const TFileOperationProgressType & Other); void __fastcall AssignButKeepSuspendState(const TFileOperationProgressType & Other); void __fastcall AddLocallyUsed(__int64 ASize); diff --git a/source/core/Global.h b/source/core/Global.h index 07f2f18c6..d6a3cb54d 100644 --- a/source/core/Global.h +++ b/source/core/Global.h @@ -49,7 +49,8 @@ private: //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- #include -#define ACCESS_VIOLATION_TEST { (*((volatile int*)NULL)) = 0; } +// Mere write to constant null pointer would be optimized out by Clang, so we need to calculate one +#define ACCESS_VIOLATION_TEST { (*strchr(const_cast(""), 'a')) = 0; } #if defined(_DEBUG) && !defined(DESIGN_ONLY) #define DODEBUGGING #endif diff --git a/source/core/Http.cpp b/source/core/Http.cpp index b4999124e..0daaa2598 100644 --- a/source/core/Http.cpp +++ b/source/core/Http.cpp @@ -6,7 +6,10 @@ #include "NeonIntf.h" #include "Exceptions.h" #include "ne_request.h" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreserved-id-macro" #include +#pragma clang diagnostic pop //--------------------------------------------------------------------------- const int BasicHttpResponseLimit = 102400; //--------------------------------------------------------------------------- diff --git a/source/core/Interface.h b/source/core/Interface.h index fd3d815e1..ab08d5def 100644 --- a/source/core/Interface.h +++ b/source/core/Interface.h @@ -116,6 +116,8 @@ struct TQueryParams TQueryParams(unsigned int AParams = 0, UnicodeString AHelpKeyword = HELP_NONE); TQueryParams(const TQueryParams & Source); + TQueryParams & operator =(const TQueryParams &) = default; + void Assign(const TQueryParams & Source); const TQueryButtonAlias * Aliases; diff --git a/source/core/NeonIntf.cpp b/source/core/NeonIntf.cpp index 7973c3c0a..d313d8a72 100644 --- a/source/core/NeonIntf.cpp +++ b/source/core/NeonIntf.cpp @@ -6,12 +6,15 @@ #include "Security.h" #include "Terminal.h" #include "Cryptography.h" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreserved-id-macro" extern "C" { #include #include } #include +#pragma clang diagnostic pop //--------------------------------------------------------------------------- #define SESSION_PROXY_AUTH_KEY "proxyauth" #define SESSION_TLS_INIT_KEY "tlsinit" diff --git a/source/core/PuttyIntf.cpp b/source/core/PuttyIntf.cpp index 20fcad354..7b6adbb29 100644 --- a/source/core/PuttyIntf.cpp +++ b/source/core/PuttyIntf.cpp @@ -337,7 +337,10 @@ size_t banner(Seat * seat, const void * data, size_t len) NORETURN static void SSHFatalError(const char * Format, va_list Param) { char Buf[200]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wformat-nonliteral" vsnprintf(Buf, LENOF(Buf), Format, Param); +#pragma clang diagnostic pop Buf[LENOF(Buf) - 1] = '\0'; // Only few calls from putty\winnet.c might be connected with specific diff --git a/source/core/PuttyIntf.h b/source/core/PuttyIntf.h index e2c211fae..834142703 100644 --- a/source/core/PuttyIntf.h +++ b/source/core/PuttyIntf.h @@ -10,11 +10,16 @@ void __fastcall DontSaveRandomSeed(); #include "PuttyTools.h" //--------------------------------------------------------------------------- #define MPEXT +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wconversion" extern "C" { #include // To rename ssh1_cipheralg::new member, what is a keyword in C++ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wkeyword-macro" #define new _new_ +#pragma clang diagnostic pop #include #undef new #include @@ -26,6 +31,7 @@ extern "C" // Defined in marshal.h - Conflicts with xml.xmldom.hpp #undef get_data } +#pragma clang diagnostic pop //--------------------------------------------------------------------------- UnicodeString GetCipherName(const ssh_cipher * Cipher); UnicodeString GetCompressorName(const ssh_compressor * Compressor); diff --git a/source/core/Queue.cpp b/source/core/Queue.cpp index dea4dc08f..3a6c31aa3 100644 --- a/source/core/Queue.cpp +++ b/source/core/Queue.cpp @@ -1212,7 +1212,7 @@ __fastcall TBackgroundTerminal::TBackgroundTerminal(TTerminal * MainTerminal, ActionLog->Enabled = false; } //--------------------------------------------------------------------------- -bool __fastcall TBackgroundTerminal::DoQueryReopen(Exception * /*E*/) +bool __fastcall TBackgroundTerminal::DoQueryReopen(Exception *) { bool Result; if (FItem->IsCancelled()) diff --git a/source/core/RemoteFiles.h b/source/core/RemoteFiles.h index 4d11e6044..f1fca2f96 100644 --- a/source/core/RemoteFiles.h +++ b/source/core/RemoteFiles.h @@ -23,6 +23,7 @@ class TRemoteToken { public: __fastcall TRemoteToken(); + TRemoteToken(const TRemoteToken &) = default; explicit __fastcall TRemoteToken(const UnicodeString & Name); void __fastcall Clear(); @@ -444,6 +445,7 @@ public: __fastcall TRemoteProperties(); __fastcall TRemoteProperties(const TRemoteProperties & rhp); + TRemoteProperties & operator =(const TRemoteProperties &) = default; bool __fastcall operator ==(const TRemoteProperties & rhp) const; bool __fastcall operator !=(const TRemoteProperties & rhp) const; void __fastcall Default(); diff --git a/source/core/S3FileSystem.h b/source/core/S3FileSystem.h index bb69a3878..f8faa32f8 100644 --- a/source/core/S3FileSystem.h +++ b/source/core/S3FileSystem.h @@ -17,7 +17,10 @@ struct TS3FileProperties; #ifdef NEED_LIBS3 // resolve clash #define S3Protocol _S3Protocol +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdocumentation" #include "libs3.h" +#pragma clang diagnostic pop #undef S3Protocol #else struct ne_session_s; diff --git a/source/core/SecureShell.cpp b/source/core/SecureShell.cpp index 720dd87f1..cb2a0b02f 100644 --- a/source/core/SecureShell.cpp +++ b/source/core/SecureShell.cpp @@ -19,7 +19,7 @@ struct TPuttyTranslation { const wchar_t * Original; int Translation; - UnicodeString HelpKeyword; + UnicodeString HelpKeyword = UnicodeString(); }; //--------------------------------------------------------------------------- struct ScpLogPolicy : public LogPolicy diff --git a/source/core/SessionInfo.h b/source/core/SessionInfo.h index 4f92dde32..2f306fe16 100644 --- a/source/core/SessionInfo.h +++ b/source/core/SessionInfo.h @@ -67,6 +67,7 @@ struct TFileSystemInfo class TSessionUI { public: + virtual __fastcall ~TSessionUI() {} virtual void __fastcall Information(const UnicodeString & Str) = 0; virtual unsigned int __fastcall QueryUser(const UnicodeString Query, TStrings * MoreMessages, unsigned int Answers, const TQueryParams * Params, diff --git a/source/core/Terminal.cpp b/source/core/Terminal.cpp index 10d1c2d32..22ef22495 100644 --- a/source/core/Terminal.cpp +++ b/source/core/Terminal.cpp @@ -17,8 +17,11 @@ #include "Cryptography.h" #include "NeonIntf.h" #include +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreserved-id-macro" #include #include +#pragma clang diagnostic pop #ifndef AUTO_WINSOCK #include diff --git a/source/filezilla/FilezillaTools.h b/source/filezilla/FilezillaTools.h index 94d109bd5..938ca407b 100644 --- a/source/filezilla/FilezillaTools.h +++ b/source/filezilla/FilezillaTools.h @@ -3,7 +3,10 @@ #define FileZillaToolsH //--------------------------------------------------------------------------- #include +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreserved-id-macro" #include +#pragma clang diagnostic pop //--------------------------------------------------------------------------- class CFileZillaTools { diff --git a/source/tb2k.cbproj b/source/tb2k.cbproj index ac37a15f3..2c194bf77 100644 --- a/source/tb2k.cbproj +++ b/source/tb2k.cbproj @@ -9,6 +9,7 @@ Win32 1 Package + c true @@ -32,6 +33,7 @@ <_TCHARMapping>wchar_t true true + false $(INTERM_PATH)\$(Platform)\$(Config) JPHNE true diff --git a/source/tbxp.cbproj b/source/tbxp.cbproj index 3a4c8d714..61e4ad8c0 100644 --- a/source/tbxp.cbproj +++ b/source/tbxp.cbproj @@ -9,6 +9,7 @@ Win32 1 Package + c true @@ -32,6 +33,7 @@ <_TCHARMapping>wchar_t true true + false $(INTERM_PATH)\$(Platform)\$(Config) JPHNE true diff --git a/source/windows/GUITools.cpp b/source/windows/GUITools.cpp index e8ad5f556..584c66298 100644 --- a/source/windows/GUITools.cpp +++ b/source/windows/GUITools.cpp @@ -1311,7 +1311,8 @@ public: protected: ICustomDoc * FCustomDoc; - #pragma warn -hid + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Woverloaded-virtual" virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID ClassId, void ** Intf) { HRESULT Result = S_OK; @@ -1329,7 +1330,7 @@ protected: } return Result; } - #pragma warn .hid + #pragma clang diagnostic pop virtual ULONG STDMETHODCALLTYPE AddRef() { diff --git a/source/windows/GUITools.h b/source/windows/GUITools.h index 8f1064762..b5641603e 100644 --- a/source/windows/GUITools.h +++ b/source/windows/GUITools.h @@ -66,7 +66,10 @@ namespace Webbrowserex { class TWebBrowserEx; } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wheader-hygiene" using namespace Webbrowserex; +#pragma clang diagnostic pop TWebBrowserEx * __fastcall CreateBrowserViewer(TPanel * Parent, const UnicodeString & LoadingLabel); void __fastcall SetBrowserDesignModeOff(TWebBrowserEx * WebBrowser); void __fastcall AddBrowserLinkHandler(TWebBrowserEx * WebBrowser, @@ -113,7 +116,10 @@ namespace Pngimagelist class TPngImageList; class TPngImageCollectionItem; } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wheader-hygiene" using namespace Pngimagelist; +#pragma clang diagnostic pop //--------------------------------------------------------------------------- TPngImageList * __fastcall GetAnimationsImages(TControl * Control); TImageList * __fastcall GetButtonImages(TControl * Control); diff --git a/source/windows/WinConfiguration.h b/source/windows/WinConfiguration.h index 7aa6e9115..2120ca8cd 100644 --- a/source/windows/WinConfiguration.h +++ b/source/windows/WinConfiguration.h @@ -257,6 +257,7 @@ struct TEditorData { __fastcall TEditorData(); __fastcall TEditorData(const TEditorData & Source); + TEditorData & operator =(const TEditorData &) = default; TFileMasks FileMask; TEditor Editor; diff --git a/source/windows/WinInterface.cpp b/source/windows/WinInterface.cpp index d269478e4..d8eef01e3 100644 --- a/source/windows/WinInterface.cpp +++ b/source/windows/WinInterface.cpp @@ -1467,9 +1467,14 @@ static void __fastcall AppGetMainFormHandle(void * /*Data*/, HWND & Handle) //--------------------------------------------------------------------------- void __fastcall WinInitialize() { + // Not sure if we need to call JclHookExceptions at all, stack trace tracking seems to work without it. + // Note though that with Clang, this does not work for exceptions explicitly raised from C++ code. + // Not a big deal for us, as we are primarily looking for system exceptions and internal exceptions raised from Pascal VCL code. if (JclHookExceptions()) { JclStackTrackingOptions << stAllModules; + // Neeeded with Clang + JclStackTrackingOptions << stRawMode; // See also StackInfoListToStrings JclExceptionStacktraceOptions >> estoIncludeAdressOffset; CallstackThread.reset(new TCallstackThread());