Unified · Split
| @@ -8693,6 +8693,9 @@ static int decl(int l) · 8692 unmodified lines | ||
| 8693 | 8693 | if (sym->type.t != VT_VOID) |
| 8694 | 8694 | tcc_error("redefinition of parameter '%s'", |
| 8695 | 8695 | get_tok_str(v, NULL)); |
| 8696 | + if (func_vt.ref->f.func_type == FUNC_OLD && | |
| 8697 | + type.t == VT_FLOAT) | |
| 8698 | + type.t = VT_DOUBLE; | |
| 8696 | 8699 | convert_parameter_type(&type); |
| 8697 | 8700 | sym->type = type; |
| 8698 | 8701 | } else if (type.t & VT_TYPEDEF) { |
| @@ -0,0 +1,23 @@ | ||
| 1 | +int printf(const char *s, ...); | |
| 2 | + | |
| 3 | +float fx(x) | |
| 4 | +float x; | |
| 5 | +{ | |
| 6 | + return 2.0 * x; | |
| 7 | +} | |
| 8 | + | |
| 9 | +int | |
| 10 | +main(void) | |
| 11 | +{ | |
| 12 | + float fy(); | |
| 13 | + | |
| 14 | + printf("%g %g\n", fx(2.0), fy(10.0)); | |
| 15 | + printf("%g %g\n", fx(2.0f), fy(10.0f)); | |
| 16 | +} | |
| 17 | + | |
| 18 | +float fy(x) | |
| 19 | +float x; | |
| 20 | +{ | |
| 21 | + return 3.0 * x; | |
| 22 | +} | |
| 23 | + | |
| @@ -0,0 +1,2 @@ | ||
| 1 | +4 30 | |
| 2 | +4 30 | |