This is the mail archive of the 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]
Other format: [Raw text]

Re: getarg_ and iargc_

On 3/17/06, Steve Kargl <> wrote:
> > Careful.  libgfortran attempts to keep its namespace clean
> by appending gfortran_ to its intrinsics procedure.

I know, I invented that, sort of (/me does the Al Gore "I invented..."
shuffle ;-)

> If
> you really want to expose getarg_ and iargc_, look at abort_.

I really do want to somehow make it easy for people to link against
libgfortran when they are compiling stuff, and not get link errors. 
That does mean exposing getarg_ and iargc_, however I'd be perfectly
fine with stuffing those exports in a separate file, for examle
g77_compat.c or whatever.  That does polute the namespace, I know. 
But IIUC the problems that this might cause could be avoided by
exporting these compatibility names as weak symbols.  The GCC manual
has as an example:

          void __f () { /* Do something. */; }
          void f () __attribute__ ((weak, alias ("__f")));

We could e.g. do.

extern void getarg_i4 (GFC_INTEGER_4 *, char *, gfc_charlen_type);
void getarg_ (GFC_INTEGER_4 *, char*, gfc_charlen_type)
     __attribute__ ((weak, alias (#IPREFIX(getarg_i4))));

or something along the line of this (I'm pretty sure the above does
not actually work ;-)

> Note, I oppose this type of change, because -std=f95 will
> loose its meaning.

I know, and that is why I'm looking for expert input for ways to get
the compatibility without destroying the goodness of a clean


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