This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/78221] [6/7 Regression] bogus warning: Non-zero imaginary part discarded in conversion [-Wconversion]


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78221

--- Comment #6 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
This looks promising:

Index: arith.c
===================================================================
--- arith.c     (Revision 241747)
+++ arith.c     (Arbeitskopie)
@@ -2369,10 +2369,10 @@ gfc_complex2real (gfc_expr *src, int kind)
       /* See if we discarded an imaginary part.  */
       if (mpfr_cmp_si (mpc_imagref (src->value.complex), 0) != 0)
        {
-         gfc_warning_now (w, "Non-zero imaginary part discarded "
-                          "in conversion from %qs to %qs at %L",
-                          gfc_typename(&src->ts), gfc_typename (&result->ts),
-                          &src->where);
+         gfc_warning (w, "Non-zero imaginary part discarded "
+                      "in conversion from %qs to %qs at %L",
+                      gfc_typename(&src->ts), gfc_typename (&result->ts),
+                      &src->where);
          did_warn = true;
        }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]