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/67219] [6/7 Regression] Incorrect conversion warning


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

--- Comment #9 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
This looks quite good.  Will see if it passes a regression-test.

Index: arith.c
===================================================================
--- arith.c     (Revision 241590)
+++ arith.c     (Arbeitskopie)
@@ -2072,11 +2072,11 @@ gfc_int2real (gfc_expr *src, int kind)

   if (warn_conversion
       && wprecision_int_real (src->value.integer, result->value.real))
-    gfc_warning_now (OPT_Wconversion, "Change of value in conversion "
-                    "from %qs to %qs at %L",
-                    gfc_typename (&src->ts),
-                    gfc_typename (&result->ts),
-                    &src->where);
+    gfc_warning (OPT_Wconversion, "Change of value in conversion "
+                "from %qs to %qs at %L",
+                gfc_typename (&src->ts),
+                gfc_typename (&result->ts),
+                &src->where);

   return result;
 }
Index: primary.c
===================================================================
--- primary.c   (Revision 241590)
+++ primary.c   (Arbeitskopie)
@@ -1353,6 +1353,7 @@ match_complex_constant (gfc_expr **result)

   if (gfc_match_char (',') == MATCH_NO)
     {
+      gfc_clear_warning ();
       gfc_pop_error (&old_error);
       m = MATCH_NO;
       goto cleanup

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