This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, Fortran, OOP] PR 46313: OOP-ABI issue, ALLOCATE issue, CLASS renaming issue


On Sun, Nov 07, 2010 at 01:04:05PM +0100, Janus Weil wrote:
> >> Yes, that is expected, because the patch changes the name of the vtab
> >> to "vtab$main$dt", so one needs to change the name of the subroutine
> >> in the test case in the same way in order to see the failure:
> >
> > Dot? vtab.main.dt?
> 
> Yes, we once had this variant. I think the reason why I switched to
> dollars was that it made the dumps easier to read (think
> "vtab.main.dt..extends..size" etc).
> 
> The best option I can currently see is to use leading underscores (as
> in "_vtab_main_dt"). This is forbidden in Fortran (cf. F08:R303), but
> accepted by the assembler (cf.
> http://sourceware.org/binutils/docs-2.20/as/Symbol-Names.html#Symbol-Names).
> 
> Attached is a patch which does this change. I also added a few macros
> in gfortran.h. Ok for trunk after successful regtest?
> 

A leading underscore moves the issue from -fdollar-ok to
-fleading_underscore.  IIRC, -fdollar-ok was introduced
to gfortran for compatibility with g77, which allows
legacy code to compile.  None of the OOP features should
appear in legacy code, so just throw an error if -fdollar-ok 
is used when an OO feature is in the code. 

-- 
Steve


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