Richard E Maine wrote:
> This has little to do with generics.
Yes, but the complaint from the compiler was about the generic (the
compiler has a bug there as my example showed)
> Calling a procedure with an
> incorrect character length is illegal
Not according to F2x (page 269:5-9 in the draft) says one can associate
an actual of larger length with a dummy of smaller length?
OK, I was trying to write an emulated C_LOC function (like the F2003
one), and after you said this I realized even in F2003 one cannot call
C_LOC for a string of length other than 1 (I gues one must use the
first letter substring)---so I should not try to do this in my
emulation either.
> Again, nothing to do with generic, but I recommend that *ALL*
> character dummy arguments be declared with a length of * unless you
> have very good and specific reasons otherwise.
The reason was interop with C---I did not want to deal with hidden
length parameters and since I only care about the address the length is
not needed. I guess I need a wrapper with LEN=* that than calls the C
function with just the first letter substring.
> > In F2x I believe we changed this a bit as now a string can be
> > associated
> > with a character array, but am not sure if generic resolution has
> > changed also or not?
> And string arrays don't make any difference in
> this regard because you can't disambiguate based on array size
> either, for exactly the same reason. You can disambiguate based on
> rank, but not on size.
That's not what I meant. I was thinking the generic would have a
character array dummy, and that you could call the generic with an
actual that is a string of arbitrary length. This would seem to be in
agreement with the changes to section 12, but I think generic
resolution rules would prohibit it, which is a bummer...BTW, why is
this new F2003 feature only for default character?
Have I said I hate the distictions between strings and character arrays
before....
Thanks,
Aleksandar
|