This really should be handled implicitly in the preprocessor, but for now this is enough.
Unified · Split
| @@ -1283,6 +1283,7 @@ ST_FUNC int type_size(CType *type, int *a); · 1282 unmodified lines | ||
| 1283 | 1283 | ST_FUNC void mk_pointer(CType *type); |
| 1284 | 1284 | ST_FUNC void vstore(void); |
| 1285 | 1285 | ST_FUNC void inc(int post, int c); |
| 1286 | +ST_FUNC void parse_mult_str (CString *astr, const char *msg); | |
| 1286 | 1287 | ST_FUNC void parse_asm_str(CString *astr); |
| 1287 | 1288 | ST_FUNC int lvalue_type(int t); |
| 1288 | 1289 | ST_FUNC void indir(void); |
| @@ -1079,6 +1079,7 @@ static void parse_asm_operands(ASMOperand *operands, int *nb_operands_ptr, · 1078 unmodified lines | ||
| 1079 | 1079 | if (tok != ':') { |
| 1080 | 1080 | nb_operands = *nb_operands_ptr; |
| 1081 | 1081 | for(;;) { |
| 1082 | + CString astr; | |
| 1082 | 1083 | if (nb_operands >= MAX_ASM_OPERANDS) |
| 1083 | 1084 | tcc_error("too many asm operands"); |
| 1084 | 1085 | op = &operands[nb_operands++]; |
| @@ -1091,11 +1092,10 @@ static void parse_asm_operands(ASMOperand *operands, int *nb_operands_ptr, · 6 unmodified lines | ||
| 1091 | 1092 | next(); |
| 1092 | 1093 | skip(']'); |
| 1093 | 1094 | } |
| 1094 | − if (tok != TOK_STR) | |
| 1095 | − expect("string constant"); | |
| 1096 | − op->constraint = tcc_malloc(tokc.str.size); | |
| 1097 | − strcpy(op->constraint, tokc.str.data); | |
| 1098 | − next(); | |
| 1095 | + parse_mult_str(&astr, "string constant"); | |
| 1096 | + op->constraint = tcc_malloc(astr.size); | |
| 1097 | + strcpy(op->constraint, astr.data); | |
| 1098 | + cstr_free(&astr); | |
| 1099 | 1099 | skip('('); |
| 1100 | 1100 | gexpr(); |
| 1101 | 1101 | if (is_output) { |
| @@ -2982,7 +2982,7 @@ ST_FUNC void inc(int post, int c) · 2981 unmodified lines | ||
| 2982 | 2982 | vpop(); /* if post op, return saved value */ |
| 2983 | 2983 | } |
| 2984 | 2984 | |
| 2985 | −static void parse_mult_str (CString *astr, const char *msg) | |
| 2985 | +ST_FUNC void parse_mult_str (CString *astr, const char *msg) | |
| 2986 | 2986 | { |
| 2987 | 2987 | /* read the string */ |
| 2988 | 2988 | if (tok != TOK_STR) |
| @@ -2544,7 +2544,7 @@ static __inline__ __const__ unsigned int swab32(unsigned int x) · 2543 unmodified lines | ||
| 2544 | 2544 | __asm__("xchgb %b0,%h0\n\t" /* swap lower bytes */ |
| 2545 | 2545 | "rorl $16,%0\n\t" /* swap words */ |
| 2546 | 2546 | "xchgb %b0,%h0" /* swap higher bytes */ |
| 2547 | − :"=q" (x) | |
| 2547 | + :"=" "q" (x) | |
| 2548 | 2548 | : "0" (x)); |
| 2549 | 2549 | return x; |
| 2550 | 2550 | } |