(j3.2006) Compilers disagree

Robert Corbett Robert.Corbett
Wed Oct 28 02:41:43 EDT 2009


dick.hendrickson at att.net wrote:
> 
>  
> 
>     -------------- Original message from Robert Corbett
>     <Robert.Corbett at Sun.COM>: --------------
> 
> 
>      > dick.hendrickson at att.net wrote:
>      > >
>      > > I think it's paragraph 7 on the top of page 151 in specification
>      > > expressions.
>      > >
>      > > Dick Hendrickson
>      >
>      > I agree that covers the case and the code fragment is not
>      > standard conforming. Because the restriction is not a
>      > constraint, there is no requirement for a standard-conforming
>      > processor to diagnose the nonstandard usage.
> 
>     Maybe.  I think paragraph 4 on 109 (F2008) says that N has no type
>     when the REAL statement is encountered.

I concede that that paragraph says that N is not implicitly typed.

>     But R728 says that
>     the specification expression must be an integer expression.  That's
>     not a strong argument.  But the intent of implicit none was to force
>     compile time errors when an undeclared variable was encountered.

In this case, N is explicitly declared to be of type INTEGER, so
constraint C707 is satisfied.

>     Using a variable with "no type" violates most of the expression
>     syntax rules. 

I do not agree that it violates any syntax rules.  Constext-free
grammars are not up to that job.  It would usually violate a
constraint.

In my study of this issue, I did notice a problem with the final
sentence of paragraph 7 on page 151.  It states

      If a variable in a specification expression is typed by
      the implicit typing rules, its appearance in any
      subsequent type declaration statement shall confirm the
      implied type and type parameters.

Paragraph 4 on page 109 clearly states that if a data entity
is declared by a type declaration statement, it is not declared
implicitly.  Therefore, an entity typed by the implicitly
typing rules cannot appear in a type declaration statement.

Bob Corbett

>     Dick Hendrickson
> 
> 
>      >
>      > Bob Corbett
>      >
>      > > -------------- Original message from Van Snyder
>      > > : --------------
>      > >
>      > >
>      > > > My compilers disagree concerning whether this is legal:
>      > > >
>      > > > subroutine before ( A, N )
>      > > > implicit NONE
>      > > > real A(N)
>      > > > integer N
>      > > > end subroutine before
>      > > >
>      > > > I thought the declaration for N had to precede its use in the
>      > > > declaration for A, but I can't find the relevant requirement.
>      > > >
>      > > > Is it there, or am I imagining it?
>      > > >
>      > > > --
>      > > > Van Snyder | What fraction of Americans believe
>      > > > Van.Snyder at jpl.nasa.gov | Wrestling is real and NASA is fake?
>      > > > Any alleged opinions are my own and have not been approved or
>      > > > disapproved by JPL, CalTech, NASA, the President, or anybody
>     else.
>      > > >
>      > > > _______________________________________________
>      > > > J3 mailing list
>      > > > J3 at j3-fortran.org
>      > > > http://j3-fortran.org/mailman/listinfo/j3
>      > >
>      > >
>      > >
>     ------------------------------------------------------------------------
> 
>      > >
>      > > _______________________________________________
>      > > J3 mailing list
>      > > J3 at j3-fortran.org
>      > > http://j3-fortran.org/mailman/listinfo/j3
>      >
>      > _______________________________________________
>      > J3 mailing list
>      > J3 at j3-fortran.org
>      > http://j3-fortran.org/mailman/listinfo/j3 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> J3 mailing list
> J3 at j3-fortran.org
> http://j3-fortran.org/mailman/listinfo/j3




More information about the J3 mailing list