> Because boolean_type_node was different?  Well, are really _all_ boolean
> types this way or can you keep using BOOLEAN_TYPE for boolean_type_node for
> things like interfacing to C and C++ (and the builtins, etc.) and use
> ENUMERAL_TYPE for the cases where bool can have non zero/one values?

They are all like that.  In a valid program, they can have only zero or one as 
values but, unlike C, in Ada you cannot avert your yes on undefined behaviour, 
you need to handle it gracefully enough, hence the need to have a base type 
for them (i.e. size of mode == precision).  ENUMERAL_TYPE would not really 
work either for the same reason.  So we would need INTEGER_TYPE for strict 
correctness, but this would add casts from/to boolean_type_node all over the 
place so is not very appealing either.

-- 
Eric Botcazou

Reply via email to