The case below previously was causing an assertion failure in the target specific generator. It probably is not incorrect not to allow this even if gcc does. struct S { long b; }; void f(struct S *x) { struct S y[1] = { *x }; }
Unified · Split
| @@ -2523,10 +2523,13 @@ static void gen_assign_cast(CType *dt) · 2522 unmodified lines | ||
| 2523 | 2523 | case VT_LLONG: |
| 2524 | 2524 | if (sbt == VT_PTR || sbt == VT_FUNC) { |
| 2525 | 2525 | tcc_warning("assignment makes integer from pointer without a cast"); |
| 2526 | + } else if (sbt == VT_STRUCT) { | |
| 2527 | + goto case_VT_STRUCT; | |
| 2526 | 2528 | } |
| 2527 | 2529 | /* XXX: more tests */ |
| 2528 | 2530 | break; |
| 2529 | 2531 | case VT_STRUCT: |
| 2532 | + case_VT_STRUCT: | |
| 2530 | 2533 | tmp_type1 = *dt; |
| 2531 | 2534 | tmp_type2 = *st; |
| 2532 | 2535 | tmp_type1.t &= ~(VT_CONSTANT | VT_VOLATILE); |