WinCE support in LD

Geoff Keating geoffk@cygnus.com
Thu Feb 24 13:16:00 GMT 2000


> Date: Wed, 23 Feb 2000 20:59:04 -0500
> From: DJ Delorie <dj@delorie.com>
> CC: ian@zembu.com, nickc@cygnus.com, binutils@sourceware.cygnus.com
> 
> 
> > Still, wouldn't something like
> > 
> > 	case THIS | THAT:
> > 
> > be clearer?
> 
> Not when both THIS and THAT are the same value.

I'd recommend using a macro (or similar):

#define JOIN (a, b) ((a) * 32 + (b))

switch (JOIN (v1, v2))
{
   case JOIN (v1, v2):

}

This may allow the compiler to generate better code (using a table
instead of a branch tree) for the switch if you can make it more
compact, and it makes the source clearer.

I'm not sure if I would really put a space after the macro in the
cases; it looks _very_ weird.

Care, though;

   case (3, 4):

is apparently legal C.

-- 
- Geoffrey Keating <geoffk@cygnus.com>


More information about the Binutils mailing list