*ping* Re: [PATCH] PR fortran/89100 Default widths for i, f and g format specifiers in format strings

Mark Eggleston mark.eggleston@codethink.co.uk
Mon Jun 3 11:54:00 GMT 2019


On 24/05/2019 15:29, Mark Eggleston wrote:
>
> On 24/05/2019 11:33, Jakub Jelinek wrote:
>> On Fri, May 24, 2019 at 11:28:34AM +0100, Mark Eggleston wrote:
>>>> FAIL: gfortran.dg/fmt_f_default_field_width_3.f90   -O   (test for
>>>> errors, line 33)
>>>> PASS: gfortran.dg/fmt_f_default_field_width_3.f90   -O (test for 
>>>> excess errors)
>>>>
>>>> that is, it seems there's no error message generated for line 33.
>>>>
>>>> Christophe
>>>>
>>> There is no error for line 33 because it isn't included in the 
>>> compilation
>>> because __GFC_REAL_16__ isn't defined. DejaGnu doesn't know this and 
>>> the
>>> dg-warning directive for this line is still processed.
>>>
>>> I don't know enough about DejaGnu directives to determine whether this
>>> situation can be handled. Does anybody know how to deal with a line 
>>> that if
>>> compiled a warning message output and if not compiled there is no 
>>> output?
>>>
>>> Is the easiest solution to omit the test code where kind=16?
>> You can do (pseudo patch, untested):
>>   #ifdef __GFC_REAL_16__
>>        real_16 = 4.18
>> -     write(buffer, fmt) ':',real_16,':' ! { dg-error "Positive width 
>> required" }
>> +     write(buffer, fmt) ':',real_16,':' ! { dg-error "Positive width 
>> required" "" { target fortran_real_16 } }
>>   #endif
>>
>> Effective target fortran_real_16 should be true whenever:
>>          real(kind=16) :: x
>>          x = cos (x)
>>          end
>> compiles and links into an executable without diagnostics.
>>
>>     Jakub
>>
> Thanks Jakub. It's taken awhile to verify this as I had to find out 
> how build the compiler without support for kind=16. Please find 
> attached the fix for using dg-error within #ifdef ... #endif
>
> testsuite change log
>
>     Mark Eggleston <mark.eggleston@codethink.com>
>
>     PR fortran/89100
>     * gfortran.dg/fmt_f_default_field_width_3.f90: Modify dg-error to 
> allow
>     use when kind=16 is not supported.
>     * gfortran.dg/fmt_g_default_field_width_3.f90: Modify dg-error to 
> allow
>     use when kind=16 is not supported.
>
Please can someone commit this as I do not have the privileges to do so.

Mark

-- 
https://www.codethink.co.uk/privacy.html



More information about the Fortran mailing list