Switch -Wunused-variable on?

Maciej W. Rozycki macro@codesourcery.com
Wed Apr 25 15:57:00 GMT 2012


On Wed, 25 Apr 2012, Andreas Schwab wrote:

> > -- "i" is now live in all cases and also IMHO handle_frobnication is more 
> > readable.
> 
> It also requires an unconditional declaration and definition of
> target_frobnicate_harder.

 Yes, but do you see at as advantage or disadvantage?

 Please note that my example can be easily adapted to a three-way choice 
where the value of target_frobnicate_harder can only be determined at the 
run time, e.g.:

#ifdef TARGET_NEEDS_HARD_FROBNICATION
#define target_needs_hard_frobnication 1
#else if defined TARGET_SUPPORTS_HARD_FROBNICATION
int target_needs_hard_frobnication;
#else
#define target_needs_hard_frobnication 0
endif

and then you still have all the conditional bits localised here and don't 
have to modify handle_frobnication at at all. :)

  Maciej



More information about the Gdb mailing list