[FORTRAN] New -fboz-kind option to aid compilation of legacy code

Brooks Moses brooks.moses@codesourcery.com
Tue Nov 14 06:27:00 GMT 2006


Steve Kargl wrote:
> On Mon, Nov 13, 2006 at 06:36:13PM -0800, Brooks Moses wrote:
>> Though I agree that the "largest decimal representation" wording should 
>> be improved, I don't quite like the idea of an integer type with an 
>> "exponent range".  Perhaps just "largest range"?
> 
> Check the Standard.  That wording comes directly from F2003.

Fair point; it does say exactly that.  I still don't like the wording 
despite the provenance, but I won't object if you want to leave it.

>> Also, there isn't a check to confirm that a valid kind type is supplied, 
>> and so I'll bet you ICE on an invalid kind.  Unfortunately, this can't 
>> be checked in options.c (despite the fact that -qkind tried to do it 
>> that way), since the kind types haven't been processed when that's run. 
> 
> gfc_convert_integer issues an error of the form
> 
> Error: Can't convert INTEGER(42) to INTEGER(4) at (1).
> 
> If you prefer I can add a call to gfc_validate_kind right before
> the BOZ conversion.

I think a slightly clearer error would be better, yeah.  I'm also still 
in favor of having it be a fatal error that happens once at startup 
before any code processing occurs, like the other errors that come from 
invalid options, but I wouldn't object too strenuously to having it 
happen at the point of conversion instead.

- Brooks



More information about the Gcc-patches mailing list