[patch, fortran] Fix PR34505 - improved checking for [D]FLOAT and SNGL

Jerry DeLisle jvdelisle@verizon.net
Wed May 19 02:43:00 GMT 2010


On 05/13/2010 10:46 AM, Daniel Franke wrote:
> On Thursday 13 May 2010 19:23:50 Daniel Franke wrote:
>> On Thursday 13 May 2010 19:06:47 Steve Kargl wrote:
>>> On Thu, May 13, 2010 at 06:44:28PM +0200, Daniel Franke wrote:
>>>> Attached patch improves the checking of [D]FLOAT and SNGL by rejecting
>>>> the wrong types and adding a -std= warning/error if used with other
>>>> kinds than the expected ones.
>>>>
>>>> Further, I removed the individual docs of FLOAT, DFLOAT and SNGL and
>>>> added them as specific names to REAL instead.
>>>
>>> Daniel,
>>>
>>> While I believe what you have done is correct, have
>>> you tested this change with some of the older codes
>>> at netlib, e.g., blas, lapack, minpack, specfcn?
>>> I have a bad feeling that FLOAT, DFLOAT and SNGL
>>> are ripe for vendor extension abuse.
>>
>> no, I didn't. And I just realized that there's still an error somewhere,
>> KIND(DBLE(42)) now returns 4, not 8. Sh ... ame.
>>
>> Be back later with an update.
>
> Ok, while regtesting: there's no visible change for FLOAT and SINGLE besides
> the additional warnings/errors which are only given with -pedantic or -std=*.
> Hence not an issue for legacy apps.
>
> Up until now, DFLOAT accepts any numerical type, same as DBLE. DFLOAT is
> documented as GNU extension (but marked as F77 in intrinsic.c). Taken the
> naming, it was probably meant as specific for FLOAT - thus the request in the
> PR to change it to allow default INTEGER only. With the patch, it accepts any
> INTEGER kind. The docs of g77 list INTEGER as argument type only, nothing
> else.
>
> To summarize, there shouldn't be much ground for trouble.
>
> Attached update fixes the lapse with the return value kind of DFLOAT (wrong
> simplifier) and adds kind-verification to the testcases ^^
>
> Cheers
>
> 	Daniel
This one is OK.

Jerry



More information about the Fortran mailing list