- /* Do not inline variadic functions. */
- if (get_method_variadicity(get_entity_type(ent)) == variadicity_variadic) {
- /* Arg, KR functions are marked as variadic one's, so check further */
- ir_type *mtp = get_entity_type(ent);
- ir_type *ctp = get_Call_type(call);
- int n_params = get_method_n_params(mtp);
- int i;
-
- /* This is too strong, but probably ok. Function calls with a wrong number of
- parameters should not be inlined. */
- if (n_params != get_method_n_params(ctp))
- return 0;
-
- /* check types: for K&R calls, this was not done by the compiler. Again, this is
- too strong, but ok for now. */
- for (i = n_params - 1; i >= 0; --i) {
- ir_type *param_tp = get_method_param_type(mtp, i);
- ir_type *arg_tp = get_method_param_type(ctp, i);
+ mtp = get_entity_type(ent);
+ ctp = get_Call_type(call);
+ if (get_method_n_params(mtp) > get_method_n_params(ctp)) {
+ /* this is a bad feature of C: without a prototype, we can can call a function with less
+ parameters than needed. Currently we don't support this, although it would be
+ to use Unknown than. */
+ return 0;
+ }