Re: [rfc][03/37] Eliminate builtin_type_ macros: Extract bitstring subscript handling

Ulrich Weigand
2008-09-05T20:17:05Z

Joel Brobecker wrote:
> > * valarith.h (value_bitstring_subscript): New function.
> > (value_subscript): No longer handle TYPE_CODE_BITSTRING.
>
> Perhaps it would be worth mentioning in the function description
> that it no longer handle bitstrings?

Makes sense. I've added the following text:

@@ -171,6 +171,11 @@ an integer nor a pointer of the same typ
}

/* Return the value of ARRAY[IDX].
+
+ ARRAY may be of type TYPE_CODE_ARRAY or TYPE_CODE_STRING. If the
+ current language supports C-style arrays, it may also be TYPE_CODE_PTR.
+ To access TYPE_CODE_BITSTRING values, use value_bitstring_subscript.
+
See comments in value_coerce_array() for rationale for reason for
doing lower bounds adjustment here rather than there.
FIXME: Perhaps we should validate that the index is valid and if