On 7/22/21 1:54 AM, Tobias Burnus wrote: > Hi Sandra, > > On 21.07.21 20:01, Sandra Loosemore wrote: >> Hmmm. CFI_establish explicitly says that the elem_len has to be >> greater than zero.  It seems somewhat confusing that it's inconsistent >> with the other functions that take an elem_len argument. > > Congratulation – we have found a bug in the spec, which is also > present in the current draft (21-007). I have now written to J3: > https://mailman.j3-fortran.org/pipermail/j3/2021-July/013189.html That discussion seems to have wandered off into some other direction so I'm not sure whether it really clarifies this problem. For the purposes of this patch I have left in the test for elem_len > 0 in CFI_establish where the standard explicitly has that requirement and removed it from the other functions where I'd added it just to be consistent. >>> How about PRIiPTR + ptrdiff_t instead of %d + (int) cast? At least as >>> positive value, extent may exceed INT_MAX. >> Hmmm, there are similar problems in existing code in other functions >> in this file (e.g., CFI_section). > > I think that you could fix as well. At least for size(array), it is not > uncommon that this exceeds MAX_INT. OK, I have done that throughout the file, and also made the wording change you asked for. While I was at it, I went through all the diagnostic messages in the file and simplified the wording of a few other messages as well, fixed typos and inconsistent capitalization and missing punctuation and things like that. As documentation maintainer I can self-approve those changes but of course I'll address complaints from the Fortran experts with what I've done there. Here's a new patch. For this version I've split off the fixes for the new tests in the TS29113 testsuite and merged them back into a new version of the main patch, which I will be posting soon. -Sandra