diff --git a/far/exception_handler.cpp b/far/exception_handler.cpp index d8096b728c..4ebe47e94b 100644 --- a/far/exception_handler.cpp +++ b/far/exception_handler.cpp @@ -2169,10 +2169,15 @@ signal_handler::~signal_handler() extern "C" void _invalid_parameter(wchar_t const*, wchar_t const*, wchar_t const*, unsigned int, uintptr_t); #endif #else +WARNING_PUSH() +WARNING_DISABLE_CLANG("-Wmissing-noreturn") + static void _invalid_parameter(wchar_t const*, wchar_t const*, wchar_t const*, unsigned int, uintptr_t) { os::process::terminate(STATUS_INVALID_CRUNTIME_PARAMETER); } + +WARNING_POP() #endif static void invalid_parameter_handler_impl(const wchar_t* const Expression, const wchar_t* const Function, const wchar_t* const File, unsigned int const Line, uintptr_t const Reserved) diff --git a/far/filefilterparams.cpp b/far/filefilterparams.cpp index e4caf11934..3a7c897e35 100644 --- a/far/filefilterparams.cpp +++ b/far/filefilterparams.cpp @@ -450,8 +450,14 @@ string MenuString(const FileFilterParams* const FF, bool const bHighlightType, w Mask = EscapedMask; } +WARNING_PUSH() +WARNING_DISABLE_GCC("-Warray-bounds") +WARNING_DISABLE_GCC("-Wstringop-overflow") + const auto AttrStr = AttributesString(IncludeAttr, ExcludeAttr); +WARNING_POP() + string OtherFlags; OtherFlags.reserve(4); diff --git a/far/flink.cpp b/far/flink.cpp index e876677c98..f091f6e815 100644 --- a/far/flink.cpp +++ b/far/flink.cpp @@ -591,7 +591,7 @@ bool GetVHDInfo(string_view const RootDirectory, string &strVolumePath, VIRTUAL_ return false; WARNING_PUSH() -WARNING_DISABLE_GCC("-Warray-bounds=") +WARNING_DISABLE_GCC("-Warray-bounds") if(StorageType) *StorageType = StorageDependencyInfo->Version2Entries[0].VirtualStorageType; diff --git a/far/makefile_gcc_common b/far/makefile_gcc_common index a9e9877682..c8faa49170 100644 --- a/far/makefile_gcc_common +++ b/far/makefile_gcc_common @@ -229,7 +229,10 @@ ifneq ($(NO_LTO),1) CFLAGS += -flto ifndef CLANG -CFLAGS += -flto-odr-type-merging +CFLAGS += \ + -flarge-source-files \ + -flto-odr-type-merging \ + endif endif # NO_LTO @@ -243,7 +246,9 @@ endif # DEBUG # Compiler-specific flags PDB_FLAGS = \ -g \ + --start-no-unused-arguments \ -gcodeview \ + --end-no-unused-arguments \ LLD_FLAGS = \ -fuse-ld=lld \ diff --git a/far/platform.sdk/sdk_gcc.h b/far/platform.sdk/sdk_gcc.h index 88070fefc5..f48203c3af 100644 --- a/far/platform.sdk/sdk_gcc.h +++ b/far/platform.sdk/sdk_gcc.h @@ -203,6 +203,11 @@ SYSTEM_THREAD_INFORMATION, *PSYSTEM_THREAD_INFORMATION; #define DEBUG_DISASM_SOURCE_LINE_NUMBER 0x00000004 #define DEBUG_DISASM_SOURCE_FILE_NAME 0x00000008 +// This particular name is unrelated, it was just added soon after IID_IDebugClient5 +// https://sourceforge.net/p/mingw-w64/mingw-w64/ci/aa3060039963b6e0c2950dd78b3db66faf8d79f8/ +// https://sourceforge.net/p/mingw-w64/mingw-w64/ci/c37b1cd2058f25b02e8d7ffcf21db255e5cc3774/ +#ifndef DBG_FRAME_DEFAULT + DEFINE_GUID(IID_IDebugClient5,0xe3acb9d7,0x7ec2,0x4f0c,0xa0,0xda,0xe8,0x1e,0x0c,0xbb,0xe6,0x28); DEFINE_GUID(IID_IDebugOutputCallbacksWide,0x4c7fd663,0xc394,0x4e26,0x8e,0xf1,0x34,0xad,0x5e,0xd3,0x76,0x4c); @@ -323,10 +328,13 @@ DECLARE_INTERFACE_(IDebugOutputCallbacksWide, IUnknown) #endif +#endif // DBG_FRAME_DEFAULT + #ifndef STACK_FRAME_TYPE_INLINE #define STACK_FRAME_TYPE_INLINE 0x02 #define STACK_FRAME_TYPE_IGNORE 0xFF +// dbghelp.h #define SYM_STKWALK_DEFAULT 0x00000000 typedef union _INLINE_FRAME_CONTEXT diff --git a/far/sqlite.c b/far/sqlite.c index 4bd3530174..205ccfd851 100644 --- a/far/sqlite.c +++ b/far/sqlite.c @@ -57,6 +57,7 @@ WARNING_DISABLE_MSC(5105) // macro expansion producing 'defined' has undefined b WARNING_DISABLE_MSC(4191) // 'operator/operation' : unsafe conversion from 'type of expression' to 'type required' WARNING_DISABLE_GCC("-Wpedantic") +WARNING_DISABLE_GCC("-Wcast-align") WARNING_DISABLE_GCC("-Wcast-function-type") WARNING_DISABLE_GCC("-Wcast-qual") WARNING_DISABLE_GCC("-Wdouble-promotion") @@ -65,6 +66,7 @@ WARNING_DISABLE_GCC("-Wimplicit-fallthrough") WARNING_DISABLE_GCC("-Wmisleading-indentation") WARNING_DISABLE_GCC("-Wmissing-declarations") WARNING_DISABLE_GCC("-Wredundant-decls") +WARNING_DISABLE_GCC("-Wstringop-overread") WARNING_DISABLE_GCC("-Wundef") WARNING_DISABLE_GCC("-Wunused-but-set-variable") #ifdef _DEBUG diff --git a/far/stack_allocator.hpp b/far/stack_allocator.hpp index 00bf88b5c2..9b9e93d83a 100644 --- a/far/stack_allocator.hpp +++ b/far/stack_allocator.hpp @@ -41,8 +41,14 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Common: // External: + +WARNING_PUSH() +WARNING_DISABLE_GCC("-Wcast-align") + #include "thirdparty/short_alloc/short_alloc.h" +WARNING_POP() + //---------------------------------------------------------------------------- template diff --git a/far/testing.hpp b/far/testing.hpp index e94f1709c7..d3bf06b9a1 100644 --- a/far/testing.hpp +++ b/far/testing.hpp @@ -47,11 +47,13 @@ WARNING_DISABLE_MSC(4459) // declaration of 'identifier' hides global declaratio WARNING_DISABLE_MSC(4800) // Implicit conversion from 'type' to bool. Possible information loss WARNING_DISABLE_MSC(5220) // 'name': a non-static data member with a volatile qualified type no longer implies that compiler generated copy/move constructors and copy/move assignment operators are not trivial WARNING_DISABLE_MSC(5267) // definition of implicit assignment operator for 'class' is deprecated because it has a user-provided destructor + WARNING_DISABLE_GCC("-Wctor-dtor-privacy") WARNING_DISABLE_GCC("-Wdouble-promotion") WARNING_DISABLE_GCC("-Wnon-virtual-dtor") WARNING_DISABLE_GCC("-Wredundant-decls") WARNING_DISABLE_GCC("-Wsubobject-linkage") + WARNING_DISABLE_CLANG("-Weverything") #define CATCH_AMALGAMATED_CUSTOM_MAIN