On Tue, 2015-05-12 at 22:21 +0200, Florian Krohm wrote:
> On 12.05.2015 21:11, Philippe Waroquiers wrote:
> > On Tue, 2015-05-12 at 18:22 +0000, sv...@va... wrote:
> >
> >> + The KIND parameter tells what kind of ADDR is allowed:
> >> + 'M' ADDR must be mapped
> >> + 'U' ADDR must be unmapped
> >> + '*' ADDR can be mapped or unmapped
> >> +*/
> >> +Bool VG_(am_addr_is_in_extensible_client_stack)( Addr addr, HChar kind )
> > Any reason why an HChar is used, rather than the classical enum ?
> > (which is usually more readable?)
>
> I felt that the encoding characters were good enough and it wasn't worth
> inventing a new type and thinking about good enumerator names.
I understand that using a HChar implies to invent less
names, but IMO, that should be limited to very local use,
not in public interfaces (as these are less readable).
Tools are also not working with constants while they are working
with enum (e.g. emacs find-tag does not work with HChar
constants, and works with enum values).
So, instead, why not use e.g.
typedef
enum { SzMapped = 0x01, // Addr in mapped stack zone
SzResvn = 0x02 // Addr in reserved (unmapped) stack zone
} StackZone;
Philippe
|