+2017-06-02 Martin Sebor <msebor@redhat.com>
+
+ PR c/80892
+ * c-warn.c (conversion_warning): Use -Wconversion for integer
+ conversion and -Wfloat-conversion for floating one.
+
2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
* c.opt (Wsizeof-pointer-div): New warning option.
"conversion from %qT to to %qT discards imaginary "
"component",
expr_type, type);
- else if (conversion_kind == UNSAFE_REAL || conversion_kind)
- warning_at (loc, OPT_Wfloat_conversion,
- "conversion from %qT to %qT may change value",
- expr_type, type);
+ else
+ {
+ int warnopt;
+ if (conversion_kind == UNSAFE_REAL)
+ warnopt = OPT_Wfloat_conversion;
+ else if (conversion_kind)
+ warnopt = OPT_Wconversion;
+ else
+ break;
+ warning_at (loc, warnopt,
+ "conversion from %qT to %qT may change value",
+ expr_type, type);
+ }
}
}
+2017-06-02 Martin Sebor <msebor@redhat.com>
+
+ PR c/80892
+ * c-c++-common/Wfloat-conversion-2.c: New test.
+
2017-06-02 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/68754