FreeBSD/contrib/gcc/c-common.c
/* Print a warning if an expression had overflow in folding and its
   operands hadn't.

   Invoke this function on every expression that
   (1) appears in the source code, and
   (2) is a constant expression that overflowed, and
   (3) is not already checked by convert_and_check;
   however, do not invoke this function on operands of explicit casts
   or when the expression is the result of an operator and any operand
   already overflowed.  */
Print a warning if an expression had overflow in folding and its
operands hadn't.

Invoke this function on every expression that
(1) appears in the source code, and
(2) is a constant expression that overflowed, and
(3) is not already checked by convert_and_check;
however, do not invoke this function on operands of explicit casts
or when the expression is the result of an operator and any operand
already overflowed.
Print a warning if an expression had overflow in folding and its operands hadn ' t . Invoke this function on every expression that ( 1 ) appears in the source code and ( 2 ) is a constant expression that overflowed and ( 3 ) is not already checked by convert_and_check ; however do not invoke this function on operands of explicit casts or when the expression is the result of an operator and any operand already overflowed .
void
overflow_warning (tree value)
{
  if (skip_evaluation) return;
  switch (TREE_CODE (value))
    {
    case INTEGER_CST:
      warning (OPT_Woverflow, "integer overflow in expression");
      break;
    case REAL_CST:
      warning (OPT_Woverflow, "floating point overflow in expression");
      break;
    case VECTOR_CST:
      warning (OPT_Woverflow, "vector overflow in expression");
      break;
    case COMPLEX_CST:
      if (TREE_CODE (TREE_REALPART (value)) == INTEGER_CST)
	warning (OPT_Woverflow, "complex integer overflow in expression");
      else if (TREE_CODE (TREE_REALPART (value)) == REAL_CST)
	warning (OPT_Woverflow, "complex floating point overflow in expression");
      break;
    default:
      break;
    }
}
void overflow_warning ( tree value ) { if ( skip_evaluation ) return ; switch ( TREE_CODE ( value ) ) { case INTEGER_CST : warning ( OPT_Woverflow , " " ) ; break ; case REAL_CST : warning ( OPT_Woverflow , " " ) ; break ; case VECTOR_CST : warning ( OPT_Woverflow , " " ) ; break ; case COMPLEX_CST : if ( TREE_CODE ( TREE_REALPART ( value ) ) == INTEGER_CST ) warning ( OPT_Woverflow , " " ) ; else if ( TREE_CODE ( TREE_REALPART ( value ) ) == REAL_CST ) warning ( OPT_Woverflow , " " ) ; break ; default : break ; } }
Print a warning if an expression had overflow in folding and its
operands hadn't.
Print a warning if an expression had overflow in folding and its operands hadn ' t .