ada: Extend precondition of Interfaces.C.String.Value with Length
commit41d7d32c04d431a74cfe030c4a1d8c07ec6c6813
authorPiotr Trojanek <trojanek@adacore.com>
Fri, 28 Jul 2023 10:13:28 +0000 (28 12:13 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 7 Aug 2023 11:14:36 +0000 (7 13:14 +0200)
tree1ce154ba6a5d4ca120ae427025d2f172bc6d5b21
parent43057533fe24b3bbcc08f7e094af6fcaf58f279e
ada: Extend precondition of Interfaces.C.String.Value with Length

The existing precondition guarded against exception Dereference_Error,
but not against Constraint_Error.

The RM rule B.3.1(36/3) only mentions Constraint_Error for the Value
function which returns char_array, but the one which returns String
has the same restriction, because it is equivalent to calling the
variant which returns char_array and then converted.

gcc/ada/

* libgnat/i-cstrin.ads (Value): Extend preconditions; adapt comment for
the package.
gcc/ada/libgnat/i-cstrin.ads