On Thu, 07 Aug 2008, Szakáts Viktor wrote:
> Hi all,
> I see that HB_SYMBOL_UNUSED() doesn't work for Pelles C.
It works for variable's symbol but it does not mark
variable's value as used in POCC.
> Is there anyone with a suggestion to make it work?
> even this won't work:
> var = var + 1 - 1;
> this would for ints, but not for pointers:
> var += 0.0;
if( var ) {;}
But I do not know if this is clean method without RT speed/code
overhead for POCC.
Looks that if code is optimized for full reduction too early then
POCC generates warning about unused value (not variable). The
question is if it fully optimize above code. You can check it
in generated assembler code. If you want to make safe macro
which can be used in any place in nested statements then it should
be inside do ... while( 0 ), f.e.:
HB_VALUE_UNUSED( v ) do if( v ) {;} while( 0 )
for non POCC based compilers it should be empty.
best regards,
Przemek
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour