Skip to content

Commit 06f2f75

Browse files
committed
samples; Fixed missing return in non-void functions
1 parent 036c71d commit 06f2f75

File tree

8 files changed

+8
-0
lines changed

8 files changed

+8
-0
lines changed

samples/AssignmentAddressToInteger/bad.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ int main()
88
{
99
int i[10];
1010
foo(i);
11+
return 0;
1112
}

samples/AssignmentAddressToInteger/good.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ int main()
77
{
88
int i[10];
99
foo(i);
10+
return 0;
1011
}

samples/autoVariables/bad.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ int main()
88
{
99
int *c;
1010
foo(&c);
11+
return 0;
1112
}

samples/autoVariables/good.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ int main()
99
int b;
1010
int *c = &b;
1111
foo(&c);
12+
return 0;
1213
}

samples/outOfBounds/bad.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ int main()
33
{
44
char str[5];
55
strcpy(str, "0123456789abcdef");
6+
return 0;
67
}

samples/outOfBounds/good.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ int main()
33
{
44
char str[10];
55
snprintf(str, 10, "%s", "abc");
6+
return 0;
67
}

samples/syntaxError/bad.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
int main()
22
{
3+
return 0;
34
#ifdef A
45
}
56
#endif

samples/syntaxError/good.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ int main()
22
{
33
#ifndef A
44
#endif
5+
return 0;
56
}

0 commit comments

Comments
 (0)