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
22582258 st = &vtop->type; /* source type */
22592259 dbt = dt->t & VT_BTYPE;
22602260 sbt = st->t & VT_BTYPE;
2261+ if (sbt == VT_VOID)
2262+ tcc_error("Cannot assign void value");
22612263 if (dt->t & VT_CONSTANT)
22622264 tcc_warning("assignment of read-only location");
22632265 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