FreeBSD/contrib/gcc/c-common.c
/* Print a warning if a large constant is truncated to unsigned,
   or if -Wconversion is used and a constant < 0 is converted to unsigned.
   Invoke this function on every expression that might be implicitly
   converted to an unsigned type.  */
Print a warning if a large constant is truncated to unsigned,
or if -Wconversion is used and a constant < 0 is converted to unsigned.
Invoke this function on every expression that might be implicitly
converted to an unsigned type.
Print a warning if a large constant is truncated to unsigned or if - Wconversion is used and a constant < 0 is converted to unsigned . Invoke this function on every expression that might be implicitly converted to an unsigned type .
static void
unsigned_conversion_warning (tree result, tree operand)
{
  tree type = TREE_TYPE (result);
  if (TREE_CODE (operand) == INTEGER_CST
      && TREE_CODE (type) == INTEGER_TYPE
      && TYPE_UNSIGNED (type)
      && skip_evaluation == 0
      && !int_fits_type_p (operand, type))
    {
      if (!int_fits_type_p (operand, c_common_signed_type (type)))
	warning (OPT_Woverflow,
		 "large integer implicitly truncated to unsigned type");
      else
	warning (OPT_Wconversion,
		 "negative integer implicitly converted to unsigned type");
    }
}
static void unsigned_conversion_warning ( tree result , tree operand ) { tree type = TREE_TYPE ( result ) ; if ( TREE_CODE ( operand ) == INTEGER_CST && TREE_CODE ( type ) == INTEGER_TYPE && TYPE_UNSIGNED ( type ) && skip_evaluation == 0 && ! int_fits_type_p ( operand , type ) ) { if ( ! int_fits_type_p ( operand , c_common_signed_type ( type ) ) ) warning ( OPT_Woverflow , " " ) ; else warning ( OPT_Wconversion , " " ) ; } }
Print a warning if a large constant is truncated to unsigned,
or if -Wconversion is used and a constant < 0 is converted to unsigned.
Print a warning if a large constant is truncated to unsigned or if - Wconversion is used and a constant < 0 is converted to unsigned .
/* This detects cases like converting -129 or 256 to unsigned char.  */