https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119118

--- Comment #2 from kargls at comcast dot net ---
On 3/4/25 16:33, jvdelisle at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119118
> 
> Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:
> 
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                   CC|                            |jvdelisle at gcc dot gnu.org
> 
> --- Comment #1 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
> I am thinking all of these should just be rejected.
> 

It's an interpretation thing.  F2023, 9.4.1

   Let the characters in the parent string be numbered 1, 2, 3, ..., n,
   where n is the length of the parent string.  Then the characters in
   the substring are those from the parent string from the starting point
   and proceeding in sequence up to and including the ending point. If
   the starting point is greater than the ending point, the substring
   has length zero; otherwise, both the starting point and the ending
   point shall be within the range 1, 2, ..., n.

For the substring 'str(-1,-2)' the starting point is greater that then
end point.  The 'otherwise' clause does not apply.  Odd.

Reply via email to