From 78c076a70f562fc88bcd6e467bfe61b856f91fbd Mon Sep 17 00:00:00 2001 From: seyko Date: Fri, 20 Mar 2015 10:44:26 +0300 Subject: [PATCH] restore a linux 2.4.26 kernel compilation (commit 5bcc3eed7b93 correction) 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. --- tccgen.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tccgen.c b/tccgen.c index f757453d..8c30c401 100644 --- a/tccgen.c +++ b/tccgen.c @@ -3776,8 +3776,12 @@ ST_FUNC void unary(void) gen_cast(&type); } } else if (tok == '{') { + /* if (nocode_wanted) - tcc_error("statement expression in global scope"); + tcc_error("statement expression in global scope"); */ + /* this check breaks compilation of the linux 2.4.26 with the meesage: + linux/include/net/tcp.h:945: error: statement expression in global scope */ + /* save all registers */ save_regs(0); /* statement expression : we do not accept break/continue