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:
1 parent
79ca8ac3bd
commit
4c6f2e7611
2 files changed
+8
-6
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user