This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: again about MXUNIT in f2c library.
>Guys (and of course girls) !
>
>what if we add one line to the definition of unit structure in fio.h ?
>it could help us to remove MXUNIT later.
I don't see enough explanation there as to what that added line would
achieve. Isn't that structure what libI77 uses as the building-block
for the f__units array, which is made MXUNIT elements long, and isn't
that array *indexed* by the unit number?
So what code, exactly, benefits from adding the unit number into the
structure? I can imagine error-reporting might be better in layers
below the libI77 interface itself, but I don't know whether there are
any such layers (I mean that don't get the unit number anyway, but
want to report errors -- especially since the interface layer probably
sets a global variable identifying the unit number currently being
processed).
I've always assumed removing MXUNIT is pretty easy -- just add code
to handle the case where the unit number is outside the range by
looking into, and if necessary allocating more chunks to, a pool
of `unit' structures for out-of-range unit numbers, or something like
that. No need to change `unit' itself, unless you want a simple-minded
linked list of out-of-range numbers (though that might be too slow
for some applications).
The hardest part is probably getting dmg to either do, or accept, such
a patch in netlib's libf2c. I don't recommend libg2c-specific changes
at this point.
tq vm, (burley)