fix(判题): C 里 main() 前面没写 int,升 gcc-14 之后直接编译错误,原来能过
Deploy / deploy (push) Canceled after 0s

gcc-14 把 -Wimplicit-int 也提成了 error。全库判过的 C 提交里有 45 条这么写(8 条 AC),
重新编译一遍:不放行全是 CE,放行后 45 条全部编译通过。最近一条因此 CE 的在 2026-09-28。
冒烟测试那条宽松度用例把 main 改成省略 int 的写法。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-09-30 10:56:17 +08:00
1 parent 79ca8ac3bd
commit 4c6f2e7611
2 files changed
+8 -6

No files matched your search

+4 -3
View File
@@ -67,16 +67,17 @@ int main(void) {
}`,
},
{
// gcc-14 把 int 函数里不带值的 return; 也提成了 error(-Wreturn-mismatch)
// gcc-14 把 int 函数里不带值的 return;(-Wreturn-mismatch)、省略 int 的
// main()(-Wimplicit-int)也提成了 error
language: "C",
name: "C 不带值的 return; 仍能过(gcc 宽松度)",
name: "C 不带值的 return;、省略 int 的 main() 仍能过(gcc 宽松度)",
expect: JudgeStatus.ACCEPTED,
code: `#include <stdio.h>
int check(int a) {
if (a < 0) return;
return a;
}
int main(void) {
main(void) {
int a, b;
scanf("%d %d", &a, &b);
printf("%d\\n", check(a) + b);