From b81fef5b10eb12c2d88bdeeb257df9b29ae043ce Mon Sep 17 00:00:00 2001 From: Tobias Werth Date: Sun, 7 Dec 2025 17:33:17 +0100 Subject: [PATCH] Make example submissions work with modern gcc versions. Tested with debian chroot oldstable, stable and testing. --- .../hello/submissions/no_output/test-compile-warning.c | 2 ++ .../hello/submissions/run_time_error/test-sigsegv.c | 2 +- .../submissions/time_limit_exceeded/stress-test-fork-setsid.c | 1 + .../hello/submissions/time_limit_exceeded/test-fork.c | 1 + .../hello/submissions/wrong_answer/test-cpu-pinning.c | 1 + 5 files changed, 6 insertions(+), 1 deletion(-) diff --git a/example_problems/hello/submissions/no_output/test-compile-warning.c b/example_problems/hello/submissions/no_output/test-compile-warning.c index 5e5f1b9dc5..530483aa20 100644 --- a/example_problems/hello/submissions/no_output/test-compile-warning.c +++ b/example_problems/hello/submissions/no_output/test-compile-warning.c @@ -6,6 +6,8 @@ #include +char *gets(char *s); + int main() { char str[1000]; diff --git a/example_problems/hello/submissions/run_time_error/test-sigsegv.c b/example_problems/hello/submissions/run_time_error/test-sigsegv.c index 1b99143b70..31a39f5660 100644 --- a/example_problems/hello/submissions/run_time_error/test-sigsegv.c +++ b/example_problems/hello/submissions/run_time_error/test-sigsegv.c @@ -10,7 +10,7 @@ int main() int a[10]; int *b; - b = 10; + b = (int *) 10; *b = a[-1000000]; return 0; diff --git a/example_problems/hello/submissions/time_limit_exceeded/stress-test-fork-setsid.c b/example_problems/hello/submissions/time_limit_exceeded/stress-test-fork-setsid.c index d54f3ec859..953fc1255f 100644 --- a/example_problems/hello/submissions/time_limit_exceeded/stress-test-fork-setsid.c +++ b/example_problems/hello/submissions/time_limit_exceeded/stress-test-fork-setsid.c @@ -13,6 +13,7 @@ */ #include +#include int main() { diff --git a/example_problems/hello/submissions/time_limit_exceeded/test-fork.c b/example_problems/hello/submissions/time_limit_exceeded/test-fork.c index 574ee9b64c..35d223b2ed 100644 --- a/example_problems/hello/submissions/time_limit_exceeded/test-fork.c +++ b/example_problems/hello/submissions/time_limit_exceeded/test-fork.c @@ -10,6 +10,7 @@ */ #include +#include int main() { diff --git a/example_problems/hello/submissions/wrong_answer/test-cpu-pinning.c b/example_problems/hello/submissions/wrong_answer/test-cpu-pinning.c index daa4d08906..c49b146d9b 100644 --- a/example_problems/hello/submissions/wrong_answer/test-cpu-pinning.c +++ b/example_problems/hello/submissions/wrong_answer/test-cpu-pinning.c @@ -7,6 +7,7 @@ * @EXPECTED_RESULTS@: WRONG-ANSWER */ +#define _GNU_SOURCE #include #include #include