From 06d4e4c6ae186533d3b3d98b486cbec7d6b1c53e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Czerpak?= Date: Thu, 30 Jan 2025 16:19:59 +0100 Subject: [PATCH] 2025-01-30 16:19 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * contrib/hbcurl/core.c ! casting * include/hbcompdf.h * removed unnecassary parenthesies and indenting * src/rtl/errint.c * added #pragma GCC diagnostic ignored "-Wnull-dereference" * src/vm/dlmalloc.c - removed #pragma GCC diagnostic ignored "-Wnull-dereference" * src/vm/fm.c + added #pragma clang diagnostic ignored "-Wgnu-null-pointer-arithmetic" #pragma GCC diagnostic ignored "-Warray-bounds" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Walloc-size" --- ChangeLog.txt | 22 ++++++++++++++++++++++ contrib/hbcurl/core.c | 6 +++--- include/hbcompdf.h | 14 +++++++------- src/rtl/errint.c | 5 +++++ src/vm/dlmalloc.c | 9 --------- src/vm/fm.c | 22 +++++++++++++++++++++- 6 files changed, 58 insertions(+), 20 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 4b6652cae5..781c83aa21 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -7,6 +7,28 @@ Entries may not always be in chronological/commit order. See license at the end of file. */ +2025-01-30 16:19 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) + * contrib/hbcurl/core.c + ! casting + + * include/hbcompdf.h + * removed unnecassary parenthesies and indenting + + * src/rtl/errint.c + * added + #pragma GCC diagnostic ignored "-Wnull-dereference" + + * src/vm/dlmalloc.c + - removed + #pragma GCC diagnostic ignored "-Wnull-dereference" + + * src/vm/fm.c + + added + #pragma clang diagnostic ignored "-Wgnu-null-pointer-arithmetic" + #pragma GCC diagnostic ignored "-Warray-bounds" + #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" + #pragma GCC diagnostic ignored "-Walloc-size" + 2025-01-30 11:54 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * src/vm/Makefile * src/vm/vmmt/Makefile diff --git a/contrib/hbcurl/core.c b/contrib/hbcurl/core.c index 04dce9dfab..8899a1e6d5 100644 --- a/contrib/hbcurl/core.c +++ b/contrib/hbcurl/core.c @@ -2580,7 +2580,7 @@ HB_FUNC( CURL_WS_SEND ) { if( PHB_CURL_is( 1 ) ) { - CURLcode res = HB_CURLE_ERROR; + CURLcode res = ( CURLcode ) HB_CURLE_ERROR; size_t sent = 0; #if LIBCURL_VERSION_NUM >= 0x075600 @@ -2608,7 +2608,7 @@ HB_FUNC( CURL_WS_RECV ) { if( PHB_CURL_is( 1 ) && HB_ISBYREF( 2 ) ) { - CURLcode res = HB_CURLE_ERROR; + CURLcode res = ( CURLcode ) HB_CURLE_ERROR; size_t recv = 0; #if LIBCURL_VERSION_NUM >= 0x075600 @@ -2847,7 +2847,7 @@ HB_FUNC( CURL_MULTI_INFO_READ ) for( i = 1; i <= handles_count; i++ ) { - void ** ph = hb_arrayGetPtrGC( pHandles, i, &s_gcCURLFuncs ); + void ** ph = ( void ** ) hb_arrayGetPtrGC( pHandles, i, &s_gcCURLFuncs ); if( ph && *ph ) { PHB_CURL hbcurl = ( PHB_CURL ) *ph; diff --git a/include/hbcompdf.h b/include/hbcompdf.h index a5329357a5..93a939ca53 100644 --- a/include/hbcompdf.h +++ b/include/hbcompdf.h @@ -74,13 +74,13 @@ struct _HB_HCLASS; /* forward declaration */ /* Declared Function/Method support structure */ typedef struct _HB_HDECLARED { - const char * szName; /* the name of the symbol */ - HB_BYTE cType; - HB_USHORT iParamCount; - HB_BYTE * cParamTypes; - struct _HB_HCLASS * pClass; - struct _HB_HCLASS * ( * pParamClasses ); - struct _HB_HDECLARED * pNext; /* pointer to the next declared function */ + const char * szName; /* the name of the symbol */ + HB_BYTE cType; + HB_USHORT iParamCount; + HB_BYTE * cParamTypes; + struct _HB_HCLASS * pClass; + struct _HB_HCLASS ** pParamClasses; + struct _HB_HDECLARED * pNext; /* pointer to the next declared function */ } HB_HDECLARED, * PHB_HDECLARED; /* Declared Class support structure */ diff --git a/src/rtl/errint.c b/src/rtl/errint.c index 0780b051a9..b746573a44 100644 --- a/src/rtl/errint.c +++ b/src/rtl/errint.c @@ -62,12 +62,17 @@ void hb_errInternal( HB_ERRCODE errCode, const char * szText, const char * szPar #if defined( _MSC_VER ) && _MSC_VER >= 1800 # pragma warning(push) # pragma warning(disable:6011) +#elif defined( HB_GCC_HAS_DIAG ) && ( HB_GCC_VER >= 601 ) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wnull-dereference" #endif int * pGPF = NULL; *pGPF = 0; *( --pGPF ) = 0; #if defined( _MSC_VER ) && _MSC_VER >= 1800 # pragma warning(pop) +#elif defined( HB_GCC_HAS_DIAG ) && ( HB_GCC_VER >= 601 ) +# pragma GCC diagnostic pop #endif } diff --git a/src/vm/dlmalloc.c b/src/vm/dlmalloc.c index 349cae8d37..3a903f7c7b 100644 --- a/src/vm/dlmalloc.c +++ b/src/vm/dlmalloc.c @@ -1459,11 +1459,6 @@ DLMALLOC_EXPORT int mspace_mallopt(int, int); #ifdef _MSC_VER #pragma warning( disable : 4146 ) /* no "unsigned" warnings */ -#endif /* _MSC_VER */ -#if defined(__GNUC__) && \ - (__GNUC__ > 6 || (__GNUC__ == 6 && __GNUC_MINOR__ >= 1)) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wnull-dereference" #endif #if !NO_MALLOC_STATS #include /* for printing in malloc_stats */ @@ -6063,10 +6058,6 @@ int mspace_mallopt(int param_number, int value) { #endif /* MSPACES */ -#if defined(__GNUC__) && \ - (__GNUC__ > 6 || (__GNUC__ == 6 && __GNUC_MINOR__ >= 1)) -#pragma GCC diagnostic pop -#endif /* -------------------- Alternative MORECORE functions ------------------- */ diff --git a/src/vm/fm.c b/src/vm/fm.c index 283f7e4ff4..dac6b181e6 100644 --- a/src/vm/fm.c +++ b/src/vm/fm.c @@ -188,7 +188,23 @@ # if defined( HB_OS_WIN_64 ) # pragma warning( disable : 4267 ) # endif -# elif defined( __MINGW32__ ) +# elif defined( __clang__ ) && defined( __clang_major__ ) && __clang_major__ >= 13 +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunused-but-set-variable" +# if __clang_major__ >= 15 +# pragma clang diagnostic ignored "-Wgnu-null-pointer-arithmetic" +# endif +# elif defined( __GNUC__ ) && ( __GNUC__ > 6 || ( __GNUC__ == 6 && __GNUC_MINOR__ >= 1 ) ) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Warray-bounds" +# if __GNUC__ >= 11 +# pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +# endif /* __GNUC__ >= 11 */ +# if __GNUC__ >= 14 +# pragma GCC diagnostic ignored "-Walloc-size" +# endif /* __GNUC__ >= 14 */ +# endif +# if defined( __MINGW32__ ) # if ! defined( USE_DL_PREFIX ) && ! defined( HB_FM_DLMT_ALLOC ) # define USE_DL_PREFIX # endif @@ -224,6 +240,10 @@ # endif # elif defined( _MSC_VER ) # pragma warning( pop ) +# elif defined( __clang__ ) && defined( __clang_major__ ) && __clang_major__ >= 13 +# pragma clang diagnostic pop +# elif defined( __GNUC__ ) && ( __GNUC__ > 6 || ( __GNUC__ == 6 && __GNUC_MINOR__ >= 1 ) ) +# pragma GCC diagnostic pop # endif # if defined( HB_FM_DLMT_ALLOC ) # define malloc( n ) mspace_malloc( hb_mspace(), ( n ) )