History

Error out when assigning void value.

tcc should now error out when compiling code like: VOID ExitProcess(UINT uExitCode); (…) retCode = ExitProcess(pi.dwProcessId);

Thomas Preud'homme committed 14 years ago

Commit 3ab269c1 parent 9c25ed11 file · +2 −0Browse files

Unified · Split

tccgen.c+2−0
@@ -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) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t