public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/54234] New: -Wconversion or -Wconversion-extra should warn for CMPLX(dp,dp)
@ 2012-08-12 14:26 burnus at gcc dot gnu.org
  2012-08-12 16:12 ` [Bug fortran/54234] " kargl at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-08-12 14:26 UTC (permalink / raw)
  To: gcc-bugs

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: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-08-14 10:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-12 14:26 [Bug fortran/54234] New: -Wconversion or -Wconversion-extra should warn for CMPLX(dp,dp) burnus at gcc dot gnu.org
2012-08-12 16:12 ` [Bug fortran/54234] " kargl at gcc dot gnu.org
2012-08-12 16:23 ` tkoenig at gcc dot gnu.org
2012-08-12 19:22 ` burnus at gcc dot gnu.org
2012-08-14  9:35 ` burnus at gcc dot gnu.org
2012-08-14 10:22 ` burnus at gcc dot gnu.org
2012-08-14 10:30 ` burnus at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).