This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Intrinsic documentation for DIM, MOD and MODULO.

On Mon, Aug 19, 2019 at 09:08:12AM -0600, Jeff Law wrote:
> On 8/19/19 3:11 AM, Mark Eggleston wrote:
> > The intrinsics DIM, MOD and MODULO can accept arguments of different
> > kinds and return values with the larger of the two kinds. Notes to this
> > effect have been added as they were missing from the documentation.
> > 
> > Please find attached the patch.
> > 
> > ChangeLog:
> > 
> > gcc/fortran/ChangeLog
> > 
> >     Mark Eggleston  <>
> > 
> >     PR fortran/89236
> >     * intrinsic.texi: Add GNU extension notes to DIM, MOD, MODULO.
> > 
> Do we want to be more specific about what types are accepted as a GNU
> extension for these operators?

The current documentation already has that info.

     X           The type shall be 'INTEGER' or 'REAL'
     Y           The type shall be the same type and kind as X.

In Fortran standardese, INTEGER means any of the supported
integer kinds (e.g., INTEGER(2)).  X and Y must both be either
INTEGER or REAL, and X and Y must have the same kind type
paramter.  Mark's addition to the manual notes that the
GNU extension allows different kind type parameters, e.g.,

integer(1) i
integer(2) j
  k = dim(i,j) 

converts i to an integer(2) before executing the function.

Mark, BTW and IMHO, for minor changes/improvements to the gfortran
documentation, I consider these to be pre-approved.  For
large changes, or if you want someone to proofread a change,
then asking for commit approval is appropriate. 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]