to TYPE. */
enum conversion_safety
-unsafe_conversion_p (location_t loc, tree type, tree expr, tree result,
- bool check_sign)
+unsafe_conversion_p (tree type, tree expr, tree result, bool check_sign)
{
enum conversion_safety give_warning = SAFE_CONVERSION; /* is 0 or false */
tree expr_type = TREE_TYPE (expr);
- loc = expansion_point_location_if_in_system_header (loc);
-
expr = fold_for_warn (expr);
if (TREE_CODE (expr) == REAL_CST || TREE_CODE (expr) == INTEGER_CST)
with different type of EXPR, but it is still safe, because when EXPR
is a constant, it's type is not used in text of generated warnings
(otherwise they could sound misleading). */
- return unsafe_conversion_p (loc, type, TREE_REALPART (expr), result,
+ return unsafe_conversion_p (type, TREE_REALPART (expr), result,
check_sign);
/* Conversion from complex constant with non-zero imaginary part. */
else
if (TREE_CODE (type) == COMPLEX_TYPE)
{
enum conversion_safety re_safety =
- unsafe_conversion_p (loc, type, TREE_REALPART (expr),
+ unsafe_conversion_p (type, TREE_REALPART (expr),
result, check_sign);
enum conversion_safety im_safety =
- unsafe_conversion_p (loc, type, imag_part, result, check_sign);
+ unsafe_conversion_p (type, imag_part, result, check_sign);
/* Merge the results into appropriate single warning. */
if (TREE_CODE (type0) == INTEGER_TYPE
&& TREE_CODE (TREE_TYPE (type1)) == INTEGER_TYPE)
{
- if (unsafe_conversion_p (loc, TREE_TYPE (type1), op0,
+ if (unsafe_conversion_p (TREE_TYPE (type1), op0,
NULL_TREE, false))
{
if (complain)
if (TREE_CODE (type0) == INTEGER_TYPE
&& TREE_CODE (TREE_TYPE (type1)) == INTEGER_TYPE)
{
- if (unsafe_conversion_p (loc, TREE_TYPE (type1), op0,
+ if (unsafe_conversion_p (TREE_TYPE (type1), op0,
NULL_TREE, false))
{
if (complain)
|| TREE_CODE (type0) == INTEGER_TYPE)
&& SCALAR_FLOAT_TYPE_P (TREE_TYPE (type1)))
{
- if (unsafe_conversion_p (loc, TREE_TYPE (type1), op0,
+ if (unsafe_conversion_p (TREE_TYPE (type1), op0,
NULL_TREE, false))
{
if (complain)
extern tree c_common_signed_or_unsigned_type (int, tree);
extern void c_common_init_ts (void);
extern tree c_build_bitfield_integer_type (unsigned HOST_WIDE_INT, int);
-extern enum conversion_safety unsafe_conversion_p (location_t, tree, tree, tree,
- bool);
+extern enum conversion_safety unsafe_conversion_p (tree, tree, tree, bool);
extern bool decl_with_nonnull_addr_p (const_tree);
extern tree c_fully_fold (tree, bool, bool *, bool = false);
extern tree c_wrap_maybe_const (tree, bool);
case INTEGER_CST:
case COMPLEX_CST:
{
- conversion_kind = unsafe_conversion_p (loc, type, expr, result, true);
+ conversion_kind = unsafe_conversion_p (type, expr, result, true);
int warnopt;
if (conversion_kind == UNSAFE_REAL)
warnopt = OPT_Wfloat_conversion;
is_arith = true;
gcc_fallthrough ();
default:
- conversion_kind = unsafe_conversion_p (loc, type, expr, result, true);
+ conversion_kind = unsafe_conversion_p (type, expr, result, true);
{
int warnopt;
if (conversion_kind == UNSAFE_REAL)
but the warnings (like Wsign-conversion) have already been
given by the scalar build_conditional_expr_1. We still check
unsafe_conversion_p to forbid truncating long long -> float. */
- if (unsafe_conversion_p (loc, stype, arg2, NULL_TREE, false))
+ if (unsafe_conversion_p (stype, arg2, NULL_TREE, false))
{
if (complain & tf_error)
error_at (loc, "conversion of scalar %qH to vector %qI "
"involves truncation", arg2_type, vtype);
return error_mark_node;
}
- if (unsafe_conversion_p (loc, stype, arg3, NULL_TREE, false))
+ if (unsafe_conversion_p (stype, arg3, NULL_TREE, false))
{
if (complain & tf_error)
error_at (loc, "conversion of scalar %qH to vector %qI "