From 6c084dd649f2378632eb43693375d3dafc0c9ffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Czerpak?= Date: Fri, 19 May 2023 16:30:00 +0200 Subject: [PATCH] 2023-05-19 16:29 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * include/hbclass.ch ! fixed declaration stripping when HB_CLS_NO_DECLARATIONS is defined * src/compiler/hbmain.c ! do not generate warnings for undeclared methods when -w[12] is used. They should be emitted only for -w3 or higher (if any in the future). Thanks to Toninho for the information about the problem. --- ChangeLog.txt | 9 +++++++++ include/hbclass.ch | 4 ++-- src/compiler/hbmain.c | 6 +++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 6f107d1863..bed7485bc7 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -7,6 +7,15 @@ Entries may not always be in chronological/commit order. See license at the end of file. */ +2023-05-19 16:29 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) + * include/hbclass.ch + ! fixed declaration stripping when HB_CLS_NO_DECLARATIONS is defined + + * src/compiler/hbmain.c + ! do not generate warnings for undeclared methods when -w[12] is used. + They should be emitted only for -w3 or higher (if any in the future). + Thanks to Toninho for the information about the problem. + 2023-05-12 18:13 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * src/compiler/hbmain.c ! fixed GPFs in dummy and never finished code for strong typing and message diff --git a/include/hbclass.ch b/include/hbclass.ch index 30d0c14e2c..1d15bdfc52 100644 --- a/include/hbclass.ch +++ b/include/hbclass.ch @@ -139,8 +139,8 @@ #xcommand _HB_CLASS => #xcommand _HB_MEMBER => #xcommand DECLARE <*decl*> => - #xtranslate AS => - #xtranslate AS CLASS => + #xtranslate AS => + #xtranslate AS CLASS => #endif /* should we inherit from HBObject class by default ? */ diff --git a/src/compiler/hbmain.c b/src/compiler/hbmain.c index 0dd8a5bb50..91a18553d6 100644 --- a/src/compiler/hbmain.c +++ b/src/compiler/hbmain.c @@ -1122,6 +1122,9 @@ PHB_HDECLARED hb_compMethodAdd( HB_COMP_DECL, PHB_HCLASS pClass, const char * sz { PHB_HDECLARED pMethod; + if( HB_COMP_PARAM->iWarnings < 3 ) + return NULL; + if( ! pClass ) { char buffer[ 80 ]; @@ -1137,9 +1140,6 @@ PHB_HDECLARED hb_compMethodAdd( HB_COMP_DECL, PHB_HCLASS pClass, const char * sz printf( "\nDeclaring Method: %s of Class: %s Pointer: %li\n", szMethodName, pClass->szName, pClass ); #endif - if( HB_COMP_PARAM->iWarnings < 3 ) - return NULL; - if( ( pMethod = hb_compMethodFind( pClass, szMethodName ) ) != NULL ) { hb_compGenWarning( HB_COMP_PARAM, hb_comp_szWarnings, 'W', HB_COMP_WARN_DUP_DECLARATION, "method", szMethodName );