On Thu, Oct 24, 2024 at 07:46:28PM +0200, Thomas Koenig wrote: > > Peter Klausler noted in the discussion on github that Sun Fortran, > from which the UNSIGNED proposal was drawn, used UNSIGNED instead > of UINT for conversion of other types to UNSIGNED > (see https://docs.oracle.com/cd/E19205-01/819-5263/aevnb/index.html ). > Peter suggested that it would make sense for gfortran to follow that, > and that he would then also do the same in f18. > > For better compatibility with existing code (however much this may be), > I think it makes sense to also follow the existing practice, rather > than the J3 paper; and it also makes sense to keep such an extension > (for now, at least) synchronized between different compilers. This > might also increase the motivation of the committee to accept this > proposal. > > So, is such a patch OK in general? I would then prepare it. > There is also a documentation patch, which I have not yet finished.
As Peter and you are doing the heavy lifting with the implementation details, I think this comes down to what he and you agree upon. UINT seems to naturally fit with AINT, ANINT, INT, and NINT. The 4 intrinsic function come from F77 and the 6 character limit, which isn't an issue today. In addition, for those coming from C/C++ (uint) is used in casting. OTOH, REALi and LOGICAL are used for conversion and UNSIGNED matches the overloading of the type with the conversion function. I'll note that match.cc(gfc_match_type_spec) has to deal with REAL as a possible intrinsic function. See the comment /* REAL is a real pain because it can be a type, intrinsic subprogram, or list item in a type-list of an OpenMP reduction clause. Need to differentiate REAL([KIND]=scalar-int-initialization-expr) from REAL(A,[KIND]) and REAL(KIND,A). Logically, when this code was written the use of LOGICAL as a type-spec or intrinsic subprogram was overlooked. */ BTW, I haven't checked with code, yet. Do you permit UNSIGNED*4, etc? I would discourage such a declaration. -- Steve