On Thu, 07 Aug 2008, Szakáts Viktor wrote:
Hi Viktor,
> * include/hbdefs.h
> ! Changed HB_SYMBOL_UNUSED() to better work for all
> compilers, notably Pelles C.
do if( symbol ) {;} while( 0 )
should not be used as previous HB_SYMBOL_UNUSED() replacement because
it has a little bit different meaning and can be source of some other
warnings. The previous version:
( void ) symbol
can be used also for uninitialized parameters:
int i;
( void ) i;
and also other symbols, f.e. labels in some compilers:
lab01:
( void ) lab01;
I do not know what exactly newest POCC does but for 4.50 we should
rather intorduce:
#if defined( __POCC__ )
#define HB_VALUE_UNUSED( symbol ) do if( symbol ) {;} while( 0 )
#else
#define HB_VALUE_UNUSED( symbol ) do {;} while( 0 )
#endif
and use it in places where it generates warnings.
Does it has many of them? POCC4.5 has ~5 for such warnings.
If newest versions reports too much of them for code updating
then I suggest to make:
#if defined( __POCC__ ) && __POCC__ >= ...
#define HB_SYMBOL_UNUSED( symbol ) do if( symbol ) {;} while( 0 )
#else
#define HB_SYMBOL_UNUSED( symbol ) ( void ) symbol
#endif
> ! Fix to PFLL, although it didn't fix all GCC 4.3.1 warnings.
> These remained:
> ../../genc.c:1582: warning: unknown conversion type character 'l' in
> format
> ../../genc.c:1582: warning: too many arguments for format
Strange. It shouldn't. Is it the only one warning with above and
other were cleaned or all still exist?
On what platform does it happen?
> * contrib/gtwvg/wvgutils.c
> ! Reverted some wrong fixes from previous commit.
If you want to avoid warnings with number<->pointer conversions
on different platforms (32/64bit) then use casting to HB_PTRDIFF
or LONG_PTR in windows only code, f.e.:
( HWND ) ( LONG_PTR ) hb_parnint( 1 )
or create macro like:
#define HB_PARNVOID( n ) ( ( void * ) ( LONG_PTR ) hb_parnint( n ) )
and use:
( HWND ) HB_PARNVOID( 1 )
best regards,
Przemek
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour