FreeBSD/contrib/gcc/c-common.c
/* Print an error message for invalid operands to arith operation
   CODE with TYPE0 for operand 0, and TYPE1 for operand 1.  */
Print an error message for invalid operands to arith operation
CODE with TYPE0 for operand 0, and TYPE1 for operand 1.
Print an error message for invalid operands to arith operation CODE with TYPE0 for operand 0 and TYPE1 for operand 1 .
void
binary_op_error (enum tree_code code, tree type0, tree type1)
{
  const char *opname;
  switch (code)
    {
    case PLUS_EXPR:
      opname = "+"; break;
    case MINUS_EXPR:
      opname = "-"; break;
    case MULT_EXPR:
      opname = "*"; break;
    case MAX_EXPR:
      opname = "max"; break;
    case MIN_EXPR:
      opname = "min"; break;
    case EQ_EXPR:
      opname = "=="; break;
    case NE_EXPR:
      opname = "!="; break;
    case LE_EXPR:
      opname = "<="; break;
    case GE_EXPR:
      opname = ">="; break;
    case LT_EXPR:
      opname = "<"; break;
    case GT_EXPR:
      opname = ">"; break;
    case LSHIFT_EXPR:
      opname = "<<"; break;
    case RSHIFT_EXPR:
      opname = ">>"; break;
    case TRUNC_MOD_EXPR:
    case FLOOR_MOD_EXPR:
      opname = "%"; break;
    case TRUNC_DIV_EXPR:
    case FLOOR_DIV_EXPR:
      opname = "/"; break;
    case BIT_AND_EXPR:
      opname = "&"; break;
    case BIT_IOR_EXPR:
      opname = "|"; break;
    case TRUTH_ANDIF_EXPR:
      opname = "&&"; break;
    case TRUTH_ORIF_EXPR:
      opname = "||"; break;
    case BIT_XOR_EXPR:
      opname = "^"; break;
    default:
      gcc_unreachable ();
    }
  error ("invalid operands to binary %s (have %qT and %qT)", opname,
	 type0, type1);
}
void binary_op_error ( enum tree_code code , tree type0 , tree type1 ) { const char * opname ; switch ( code ) { case PLUS_EXPR : opname = " " ; break ; case MINUS_EXPR : opname = " " ; break ; case MULT_EXPR : opname = " " ; break ; case MAX_EXPR : opname = " " ; break ; case MIN_EXPR : opname = " " ; break ; case EQ_EXPR : opname = " " ; break ; case NE_EXPR : opname = " " ; break ; case LE_EXPR : opname = " " ; break ; case GE_EXPR : opname = " " ; break ; case LT_EXPR : opname = " " ; break ; case GT_EXPR : opname = " " ; break ; case LSHIFT_EXPR : opname = " " ; break ; case RSHIFT_EXPR : opname = " " ; break ; case TRUNC_MOD_EXPR : case FLOOR_MOD_EXPR : opname = " " ; break ; case TRUNC_DIV_EXPR : case FLOOR_DIV_EXPR : opname = " " ; break ; case BIT_AND_EXPR : opname = " " ; break ; case BIT_IOR_EXPR : opname = " " ; break ; case TRUTH_ANDIF_EXPR : opname = " " ; break ; case TRUTH_ORIF_EXPR : opname = " " ; break ; case BIT_XOR_EXPR : opname = " " ; break ; default : gcc_unreachable ( ) ; } error ( " " , opname , type0 , type1 ) ; }
Print an error message for invalid operands to arith operation
CODE with TYPE0 for operand 0, and TYPE1 for operand 1.
Print an error message for invalid operands to arith operation CODE with TYPE0 for operand 0 and TYPE1 for operand 1 .