[Fortran, patch] PR32323 - give error for vector subscript actual arguments to intent out/inout
Brooks Moses
brooks.moses@codesourcery.com
Wed Jun 13 20:08:00 GMT 2007
At 01:01 PM 6/13/2007, Bernhard Fischer wrote:
>On Wed, Jun 13, 2007 at 12:56:20PM -0700, Brooks Moses wrote:
> >>+/* Given an expression, check whether it is an array section
> >>+ which has a vector subscript. If it has, one is returned,
> >>+ otherwise zero. */
> >>+
> >>+static int
> >>+has_vector_section (gfc_expr *e)
> >
> >I think I'd find this function name a bit clearer as
> >"has_vector_subscript"; there isn't actually such a thing as a "vector
> >section", and so that seems confusing to me.
> >
> >This is, however, not a strong objection -- feel free to commit this as
> >it stands if you prefer "has_vector_section".
>
>Is there a specific reason not to return a bool in such situations,
>generally?
Hmm. Other than "that's how a lot of other functions do it", I don't know
of one -- and we certainly have plenty of functions that do return bools,
which means that we already require that they be supported in any C
compiler building gfortran.
Thus: Yes, this should return a bool, not an int.
- Brooks
More information about the Fortran
mailing list