FreeBSD/contrib/gcc/c-common.c
/* Convert EXPR to TYPE, warning about conversion problems with constants.
   Invoke this function on every expression that is converted implicitly,
   i.e. because of language rules and not because of an explicit cast.  */
Convert EXPR to TYPE, warning about conversion problems with constants.
Invoke this function on every expression that is converted implicitly,
i.e. because of language rules and not because of an explicit cast.
Convert EXPR to TYPE warning about conversion problems with constants . Invoke this function on every expression that is converted implicitly i . e . because of language rules and not because of an explicit cast .
tree
convert_and_check (tree type, tree expr)
{
  tree t = convert (type, expr);
  if (TREE_CODE (t) == INTEGER_CST)
    {
      if (TREE_OVERFLOW (t))
	{
	  TREE_OVERFLOW (t) = 0;
	  TREE_CONSTANT_OVERFLOW (t) = CONSTANT_CLASS_P (expr)
                                       && TREE_CONSTANT_OVERFLOW (expr);
	  if (!(TYPE_UNSIGNED (type) < TYPE_UNSIGNED (TREE_TYPE (expr))
		&& TREE_CODE (TREE_TYPE (expr)) == INTEGER_TYPE
		&& TYPE_PRECISION (type) == TYPE_PRECISION (TREE_TYPE (expr))))
	    if ((pedantic
		 || TYPE_UNSIGNED (type)
		 || !constant_fits_type_p (expr,
					   c_common_unsigned_type (type)))
		&& skip_evaluation == 0)
	      warning (OPT_Woverflow,
                       "overflow in implicit constant conversion");
	}
      else
	unsigned_conversion_warning (t, expr);
    }
  return t;
}
tree convert_and_check ( tree type , tree expr ) { tree t = convert ( type , expr ) ; if ( TREE_CODE ( t ) == INTEGER_CST ) { if ( TREE_OVERFLOW ( t ) ) { TREE_OVERFLOW ( t ) = 0 ; TREE_CONSTANT_OVERFLOW ( t ) = CONSTANT_CLASS_P ( expr ) && TREE_CONSTANT_OVERFLOW ( expr ) ; if ( ! ( TYPE_UNSIGNED ( type ) < TYPE_UNSIGNED ( TREE_TYPE ( expr ) ) && TREE_CODE ( TREE_TYPE ( expr ) ) == INTEGER_TYPE && TYPE_PRECISION ( type ) == TYPE_PRECISION ( TREE_TYPE ( expr ) ) ) ) if ( ( pedantic || TYPE_UNSIGNED ( type ) || ! constant_fits_type_p ( expr , c_common_unsigned_type ( type ) ) ) && skip_evaluation == 0 ) warning ( OPT_Woverflow , " " ) ; } else unsigned_conversion_warning ( t , expr ) ; } return t ; }
Convert EXPR to TYPE, warning about conversion problems with constants.
Convert EXPR to TYPE warning about conversion problems with constants .
/* Do not diagnose overflow in a constant expression merely
	     because a conversion overflowed.  */ /* No warning for converting 0x80000000 to int.  */ /* If EXPR fits in the unsigned version of TYPE,
	       don't warn unless pedantic.  */