Skip to content

Commit 9b8765d

Browse files
committed
Revert commits from OpenCode-AI and a partial regression fix
This reverts the crap from an unknown committer "OpenCode[AI]", that added an extension to TinyCC, which is incompatible to the C standard and not available in any other mainstream C compiler: * Revert "No More ; needed" This reverts commit 6547ea4 * Revert "Add AGENTS.md" This reverts commit 898f496. This also reverts a regression fix by "Zuhaitz.dev", which fixed a small part of the OpenCode-AI chaos: * Revert "tccgen: Fix optional semicolon regression" This reverts commit 169628a -- Regards ... Detlef
1 parent 7b92d2d commit 9b8765d

3 files changed

Lines changed: 10 additions & 67 deletions

File tree

‎AGENTS.md‎

Lines changed: 0 additions & 54 deletions
This file was deleted.

‎tccgen.c‎

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7205,7 +7205,7 @@ static void block(int flags)
72057205
label_push(&local_label_stack, tok, LABEL_DECLARED);
72067206
next();
72077207
} while (tok == ',');
7208-
if (tok == ';') next();
7208+
skip(';');
72097209
}
72107210

72117211
while (tok != '}') {
@@ -7241,7 +7241,7 @@ static void block(int flags)
72417241
leave_scope(root_scope);
72427242
if (b)
72437243
gfunc_return(&func_vt);
7244-
if (tok == ';') next();
7244+
skip(';');
72457245
/* jump unless last stmt in top-level block */
72467246
if (tok != '}' || local_scope != 1)
72477247
rsym = gjmp(rsym);
@@ -7258,15 +7258,15 @@ static void block(int flags)
72587258
else
72597259
leave_scope(loop_scope);
72607260
*cur_scope->bsym = gjmp(*cur_scope->bsym);
7261-
if (tok == ';') next();
7261+
skip(';');
72627262

72637263
} else if (t == TOK_CONTINUE) {
72647264
/* compute jump */
72657265
if (!cur_scope->csym)
72667266
tcc_error("cannot continue");
72677267
leave_scope(loop_scope);
72687268
*cur_scope->csym = gjmp(*cur_scope->csym);
7269-
if (tok == ';') next();
7269+
skip(';');
72707270

72717271
} else if (t == TOK_FOR) {
72727272
new_scope(&o);
@@ -7314,7 +7314,7 @@ static void block(int flags)
73147314
gexpr();
73157315
c = gvtst(0, 0);
73167316
skip(')');
7317-
if (tok == ';') next();
7317+
skip(';');
73187318
gsym_addr(c, d);
73197319
gsym(a);
73207320
prev_scope_s(&o);
@@ -7426,7 +7426,7 @@ static void block(int flags)
74267426
} else {
74277427
expect("label identifier");
74287428
}
7429-
if (tok == ';') next();
7429+
skip(';');
74307430

74317431
} else if (t == TOK_ASM1 || t == TOK_ASM2 || t == TOK_ASM3) {
74327432
asm_instr();
@@ -7481,7 +7481,7 @@ static void block(int flags)
74817481
gexpr();
74827482
vpop();
74837483
}
7484-
if (tok == ';') next();
7484+
skip(';');
74857485
}
74867486
}
74877487
}
@@ -8637,7 +8637,7 @@ static void do_Static_assert(void)
86378637
skip(')');
86388638
if (c == 0)
86398639
tcc_error("%s", msg);
8640-
if (tok == ';') next();
8640+
skip(';');
86418641
}
86428642

86438643
#ifdef TCC_TARGET_PE
@@ -8904,10 +8904,7 @@ static int decl(int l)
89048904
if (tok != ',') {
89058905
if (l == VT_JMP)
89068906
return has_init ? v : 1;
8907-
if (l == VT_CMP)
8908-
skip(';');
8909-
else if (tok == ';')
8910-
next();
8907+
skip(';');
89118908
break;
89128909
}
89138910
next();

‎tests/tests2/60_errors_and_warnings.expect‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ bar : 3 ; 3
179179
60_errors_and_warnings.c:372: error: statement expression outside of function
180180

181181
[test_invalid_tokckill]
182-
60_errors_and_warnings.c:375: warning: function might return no value: 'f'
182+
60_errors_and_warnings.c:375: error: ';' expected (got '3')
183183

184184
[test_duplicate_member]
185185
60_errors_and_warnings.c:381: error: duplicate member 'a'

0 commit comments

Comments
 (0)