| @@ -19,7 +19,6 @@ · 18 unmodified lines |
| 19 | */ | 19 | */ |
| 20 | | 20 | |
| 21 | #include "tcc.h" | 21 | #include "tcc.h" |
| 22 | | | |
| 23 | /********************************************************/ | 22 | /********************************************************/ |
| 24 | /* global variables */ | 23 | /* global variables */ |
| 25 | | 24 | |
| @@ -2938,17 +2937,26 @@ static void type_to_str(char *buf, int buf_size, · 2912 unmodified lines |
| 2938 | break; | 2937 | break; |
| 2939 | case VT_FUNC: | 2938 | case VT_FUNC: |
| 2940 | s = type->ref; | 2939 | s = type->ref; |
| 2941 | type_to_str(buf, buf_size, &s->type, varstr); | 2940 | buf1[0]=0; |
| 2942 | pstrcat(buf, buf_size, "("); | 2941 | if (varstr && '*' == *varstr) { |
| | 2942 | pstrcat(buf1, sizeof(buf1), "("); |
| | 2943 | pstrcat(buf1, sizeof(buf1), varstr); |
| | 2944 | pstrcat(buf1, sizeof(buf1), ")"); |
| | 2945 | } |
| | 2946 | pstrcat(buf1, buf_size, "("); |
| 2943 | sa = s->next; | 2947 | sa = s->next; |
| 2944 | while (sa != NULL) { | 2948 | while (sa != NULL) { |
| 2945 | type_to_str(buf1, sizeof(buf1), &sa->type, NULL); | 2949 | char buf2[256]; |
| 2946 | pstrcat(buf, buf_size, buf1); | 2950 | type_to_str(buf2, sizeof(buf2), &sa->type, NULL); |
| | 2951 | pstrcat(buf1, sizeof(buf1), buf2); |
| 2947 | sa = sa->next; | 2952 | sa = sa->next; |
| 2948 | if (sa) | 2953 | if (sa) |
| 2949 | pstrcat(buf, buf_size, ", "); | 2954 | pstrcat(buf1, sizeof(buf1), ", "); |
| 2950 | } | 2955 | } |
| 2951 | pstrcat(buf, buf_size, ")"); | 2956 | if (s->f.func_type == FUNC_ELLIPSIS) |
| | 2957 | pstrcat(buf1, sizeof(buf1), ", ..."); |
| | 2958 | pstrcat(buf1, sizeof(buf1), ")"); |
| | 2959 | type_to_str(buf, buf_size, &s->type, buf1); |
| 2952 | goto no_var; | 2960 | goto no_var; |
| 2953 | case VT_PTR: | 2961 | case VT_PTR: |
| 2954 | s = type->ref; | 2962 | s = type->ref; |
| @@ -5005,6 +5013,8 @@ ST_FUNC void unary(void) · 2050 unmodified lines |
| 5005 | skip('('); | 5013 | skip('('); |
| 5006 | expr_type(&controlling_type, expr_eq); | 5014 | expr_type(&controlling_type, expr_eq); |
| 5007 | controlling_type.t &= ~(VT_CONSTANT | VT_VOLATILE | VT_ARRAY); | 5015 | controlling_type.t &= ~(VT_CONSTANT | VT_VOLATILE | VT_ARRAY); |
| | 5016 | if ((controlling_type.t & VT_BTYPE) == VT_FUNC) |
| | 5017 | mk_pointer(&controlling_type); |
| 5008 | for (;;) { | 5018 | for (;;) { |
| 5009 | learn = 0; | 5019 | learn = 0; |
| 5010 | skip(','); | 5020 | skip(','); |