[PATCH] Fortran : Don't warn for LOGICAL kind conversion PR96319

Mark Eggleston mark.eggleston@codethink.co.uk
Tue Jul 28 07:11:54 GMT 2020


Please find attached patch for PR96319.

LOGICAL values fit regardless of kind so warnings are unnecessary. The 
PR referred to the warning produced for -Wconversion.  This patch also 
suppresses the warning for -Wconversion-extra.

-Wconversion produces

"Possible change of value in conversion from LOGICAL(4) to LOGICAL(1) ..."

-Wconversion-extra produces

"Conversion from LOGICAL(4) to LOGICAL(1) ..."

Should both warnings be suppressed or just the warning in the original PR?

Note: both messages are missing when -Wconversion -Wconversion-extra are 
used with the gfortran-9 branch.

Fortran  : Don't warn for LOGICAL kind conversion PR96319

LOGICAL values will always fit regardless of kind so there
is no need for warnings.

2020-07-28  Mark Eggleston <markeggleston@gcc.gnu.org>

gcc/fortran/

     PR fortran/96319
     * intrinsic.c (gfc_convert_type_warn):  Add check for
     LOGICAL type so that warnings are not output.

2020-07-28  Mark Eggleston <markeggleston@gcc.gnu.org>

gcc/testsuite/

     PR fortran/96319
     * gfortran.dg/pr96319.f90: New test.

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fortran-Don-t-warn-for-LOGICAL-kind-conv-PR96319.patch
Type: text/x-patch
Size: 2163 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200728/dd9ade7a/attachment.bin>


More information about the Gcc-patches mailing list