From: analyst41 on
I just had an issue (crash) with LF95 because a named common block had
the same name as a subprogram.
..

What does the standard say?

Thanks.
From: m_b_metcalf on
On Dec 17, 11:33 am, "analys...(a)hotmail.com" <analys...(a)hotmail.com>
wrote:
> I just had an issue (crash) with LF95 because a named common block had
> the same name as a subprogram.
> .
>
> What does the standard say?
>
> Thanks.

It says Lahey's right (not to crash, but to diagnose the clash).

Regards,

Mike Metcalf
From: glen herrmannsfeldt on
m_b_metcalf <michaelmetcalf(a)compuserve.com> wrote:
> On Dec 17, 11:33?am, "analys...(a)hotmail.com" <analys...(a)hotmail.com>
> wrote:
>> I just had an issue (crash) with LF95 because a named common
>> block had the same name as a subprogram.

>> What does the standard say?

> It says Lahey's right (not to crash, but to diagnose the clash).

If they are both referenced in one routine then I suppose I would
expect the compiler to notice. If they are referenced in different
routines, then on many systems it is up to the linker to notice.

I do remember that on OS/360, both subroutines and initialized
(in BLOCK DATA) COMMON blocks are both SD (that is what they are
called by the linker), where unintialized COMMON is CM. As they
look the same, there is no possibility for the linker to notice.

-- glen
From: m_b_metcalf on
On Dec 17, 1:55 pm, glen herrmannsfeldt <g...(a)ugcs.caltech.edu> wrote:
> m_b_metcalf <michaelmetc...(a)compuserve.com> wrote:
> > On Dec 17, 11:33?am, "analys...(a)hotmail.com" <analys...(a)hotmail.com>
> > wrote:
> >> I just had an issue (crash) with LF95 because a named common
> >> block had the same name as a subprogram.
> >> What does the standard say?
> > It says Lahey's right (not to crash, but to diagnose the clash).
>
> If they are both referenced in one routine then I suppose I would
> expect the compiler to notice.  If they are referenced in different
> routines, then on many systems it is up to the linker to notice.
>

program main
common/junk/i
i =1
print *, i
end program main
subroutine junk
a = 0.0
end

Error 1 Error: Declaration of globally visible name conflicts with a
common block declaration

A matter of quality of implementation.

Regards,

Mike Metcalf
From: m_b_metcalf on
P.S. That was Intel.