http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54234
Bug #: 54234
Summary: -Wconversion or -Wconversion-extra should warn for
CMPLX(dp,dp)
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P3
Component: fortran
AssignedTo: [email protected]
ReportedBy: [email protected]
When calling CMPLX with non-default-kind arguments, the compiler should warn
about the conversion, i.e. for
CMPLX (0.1_dp, 0.1_dp)
as the expression is complex(4) while the arguments are REALs with kind=8.
There should be no warning for cmplx (complex number).
Longer example – compile with -Wconversion -Wconversion-extra. Again, I'd
expect a warning for the CMPLX:
module fft_mod
implicit none
integer, parameter :: dp=selected_real_kind(15,300)
real(kind=dp), parameter :: pi=3.141592653589793238460
contains
subroutine test
integer :: x
x = int (abs (cmplx(2.3_dp,0.1_dp)))
end subroutine test
end module fft_mod