tcc should now error out when compiling code like: VOID ExitProcess(UINT uExitCode); (…) retCode = ExitProcess(pi.dwProcessId);
Unified · Split
| @@ -2258,6 +2258,8 @@ static void gen_assign_cast(CType *dt) · 2257 unmodified lines | |||
| 2258 | st = &vtop->type; /* source type */ | 2258 | st = &vtop->type; /* source type */ |
| 2259 | dbt = dt->t & VT_BTYPE; | 2259 | dbt = dt->t & VT_BTYPE; |
| 2260 | sbt = st->t & VT_BTYPE; | 2260 | sbt = st->t & VT_BTYPE; |
| 2261 | if (sbt == VT_VOID) | ||
| 2262 | tcc_error("Cannot assign void value"); | ||
| 2261 | if (dt->t & VT_CONSTANT) | 2263 | if (dt->t & VT_CONSTANT) |
| 2262 | tcc_warning("assignment of read-only location"); | 2264 | tcc_warning("assignment of read-only location"); |
| 2263 | switch(dbt) { | 2265 | switch(dbt) { |