The following check in tccgen.c is removed if (nocode_wanted) tcc_error("statement expression in global scope"); This check is introduced in commit 5bcc3eed7b93 and breaks compilation of the linux 2.4.26 kernel.
Unified · Split
| @@ -3776,8 +3776,12 @@ ST_FUNC void unary(void) · 3775 unmodified lines | ||
| 3776 | 3776 | gen_cast(&type); |
| 3777 | 3777 | } |
| 3778 | 3778 | } else if (tok == '{') { |
| 3779 | + /* | |
| 3779 | 3780 | if (nocode_wanted) |
| 3780 | − tcc_error("statement expression in global scope"); | |
| 3781 | + tcc_error("statement expression in global scope"); */ | |
| 3782 | + /* this check breaks compilation of the linux 2.4.26 with the meesage: | |
| 3783 | + linux/include/net/tcp.h:945: error: statement expression in global scope */ | |
| 3784 | + | |
| 3781 | 3785 | /* save all registers */ |
| 3782 | 3786 | save_regs(0); |
| 3783 | 3787 | /* statement expression : we do not accept break/continue |