Skip to content

Commit 8a216b7

Browse files
committed
Make example submissions work with modern gcc versions.
Tested with debian chroot oldstable, stable and testing.
1 parent 6409457 commit 8a216b7

File tree

5 files changed

+6
-1
lines changed

5 files changed

+6
-1
lines changed

example_problems/hello/submissions/no_output/test-compile-warning.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
#include <stdio.h>
88

9+
char *gets(char *s);
10+
911
int main()
1012
{
1113
char str[1000];

example_problems/hello/submissions/run_time_error/test-sigsegv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ int main()
1010
int a[10];
1111
int *b;
1212

13-
b = 10;
13+
b = (int *) 10;
1414
*b = a[-1000000];
1515

1616
return 0;

example_problems/hello/submissions/time_limit_exceeded/stress-test-fork-setsid.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*/
1414

1515
#include <unistd.h>
16+
#include <stdlib.h>
1617

1718
int main()
1819
{

example_problems/hello/submissions/time_limit_exceeded/test-fork.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*/
1111

1212
#include <unistd.h>
13+
#include <stdlib.h>
1314

1415
int main()
1516
{

example_problems/hello/submissions/wrong_answer/test-cpu-pinning.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @EXPECTED_RESULTS@: WRONG-ANSWER
88
*/
99

10+
#define _GNU_SOURCE
1011
#include <errno.h>
1112
#include <unistd.h>
1213
#include <sched.h>

0 commit comments

Comments
 (0)