[patch, fortran] PR22539 implement FSEEK intrinsic

Brooks Moses bmoses@stanford.edu
Fri May 4 05:47:00 GMT 2007


On Fri, May 04, 2007 at 08:20:54AM +0300, Janne Blomqvist wrote:
> I think the correct one would be gfc_c_int_kind, which as the name 
> implies is a C int which is what the library expects. Yes, it will be 4, 
> but it's one less magic constant sprinkled in the code.

A fair point.  However, since 4 is what's currently sprinkled in the
similar code throughout check.c, I think being consistent has some value
to it.  A patch to change _all_ of the comparisons of integer kinds
against 4 to comparisons against gfc_c_int_kind might be worthwhile,
though.

Do you think we should correspondingly change the documentation to "of
type @code{INTEGER} and a kind corresponding to the default C integer
type" rather than "of type @code{INTEGER(4)}"?

> Also, I believe g77 never supported any -fdefault-integer-8 or 
> equivalent switch, so one could argue that supporting FSEEK and other 
> g77 compatibility garbage is not necessary with -fdefault-integer-8.

We could, and that's what we do for a lot of things.

However, that the fix for this that Daniel is planning to make is going
to be required for Fortran 2003 support, regardless of how we choose to
deal with the g77 stuff.  And, once it's in place, it should be
relatively trivial to apply it to the g77 stuff too.

Whether that's a _good_ idea may be debateable.  It arguably does
encourage use of the stuff.

- Brooks



More information about the Gcc-patches mailing list