Am 16.06.25 um 02:18 schrieb Steve Kargl:
Harald,

I did a quick glance at the patch and did not see anything that
jumped out as needing a change.  OK to commit.

Earlier today I came to the same conclusion that -1 on overflow is
probably the right thing to do.  Gfortran would need a way to
supply the value of ERANGE (on all supported targets) so a
user can write a test.  Yes, POSIX seems to define ERANGE as
34, but is that guaranteed on non-POSIX targets?

After thinking some more, I am struggling with these issues:

- ERANGE may not be defined, and the value of ERANGE may not
  be portable between targets.  How to handle that on the
  Fortran side?

- my initial proposal to return ERANGE has the potentially confusing
  effect that stat(3) may be successful, only the conversion to
  integer(kind=4) has an overflow in some component.  Is it then
  helpful to return ERANGE?  Or just return -1 for those components
  and document this new behavior?

And don't forget that returning ERANGE needs adjustment of
testcases, where the only portable solution I have is the
specification of -fdefault-integer-8 ...

Harald


Reply via email to