This is the mail archive of the gcc-bugs@gcc.gnu.org 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]

Re: g77 bug with const argument


Thanks Toon, you certainly did a better job of explaining this.

I should probably just let this thread die, but I have one question:

Does g77 treat the invocation of a subroutine (and function) as if
it is PURE (i.e., that it can't have side-effects)?

      
      x = 1.       
      write(*,*) x.       write(*,*) 1.
      call b(x)           call b(1.)
   4  write(*,*) x.       write(*,*) 1.

In line 4 on the left, I would not expect x to be 1. because the call
to b() could have changed x.  In line 4 on the right, 1. is, well, 1.,i
and I would expect that it would not change even though "call b(1.)"
passes its argument by reference.


Once upon a time, Toon Moene said:
> Steven G. Kargl wrote:
> 
> > Once upon a time, craig@jcb-sc.com said:
> 
> > > Please just read the g77 docs thoroughly, especially the info on
> > > non-bugs.  You seem to be confusing *syntactic* correctness with
> > > *correctness* itself.  Also please review all sorts of related
> > > discussions, as well as the FAQ, on comp.lang.fortran (USENET).
> 

[Toon's explanation deleted]

>
> > The node non-bugs in g77.info does have anything to say about
                                  ^^^^^^^^^
Whoops                          does not have

> > this problem.
> > 
> > I read comp.lang.fortran daily.

The Fortran FAQ does not discuss this problem.

> 
> The issue about Standard conformance for parts of a program vs. a
> complete program was discussed about three weeks ago on
> comp.lang.fortran.  Dick Hendrickson claimed that one could only speak
> about the conformance of "complete programs", not subprograms.  However,
> someone else pointed out that the Standard does not say this [Quoting
> the first paragraph of Chapter 1.5 Conformance]:

Do you have a pointer to this thread?  Richard Maine has probably
offered his opinion and I am curious to the outcome.

> 
> PS: This reminds me that I should send a patch to include a URL to
>     the relevant Standard for inclusion in our Readings section ...
> 

There already is a URL under the G77 languange node.
I've downloaded the html version of the F77 standard,
so that I can understand the issues better.

-- 
Steve


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