Prev: Error when compiling using gcc440 (compiles fine with gcc412)- missing actual arg:
Next: Caveat: Can One Dim Local Arrays Using Argument List Integers ??
From: analyst41 on 17 Dec 2009 05:33 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 17 Dec 2009 05:44 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 17 Dec 2009 07:55 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 17 Dec 2009 08:45 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 17 Dec 2009 08:47
P.S. That was Intel. |