From 06f2f755488bbb86ddcce95c4fe78da390872b3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 4 Jul 2021 16:59:09 +0200 Subject: [PATCH] samples; Fixed missing return in non-void functions --- samples/AssignmentAddressToInteger/bad.c | 1 + samples/AssignmentAddressToInteger/good.c | 1 + samples/autoVariables/bad.c | 1 + samples/autoVariables/good.c | 1 + samples/outOfBounds/bad.c | 1 + samples/outOfBounds/good.c | 1 + samples/syntaxError/bad.c | 1 + samples/syntaxError/good.c | 1 + 8 files changed, 8 insertions(+) diff --git a/samples/AssignmentAddressToInteger/bad.c b/samples/AssignmentAddressToInteger/bad.c index ab4704fed..dcef286d6 100644 --- a/samples/AssignmentAddressToInteger/bad.c +++ b/samples/AssignmentAddressToInteger/bad.c @@ -8,4 +8,5 @@ int main() { int i[10]; foo(i); + return 0; } diff --git a/samples/AssignmentAddressToInteger/good.c b/samples/AssignmentAddressToInteger/good.c index 32b68628c..e52e11c16 100644 --- a/samples/AssignmentAddressToInteger/good.c +++ b/samples/AssignmentAddressToInteger/good.c @@ -7,4 +7,5 @@ int main() { int i[10]; foo(i); + return 0; } diff --git a/samples/autoVariables/bad.c b/samples/autoVariables/bad.c index c18718866..0b4287d28 100644 --- a/samples/autoVariables/bad.c +++ b/samples/autoVariables/bad.c @@ -8,4 +8,5 @@ int main() { int *c; foo(&c); + return 0; } diff --git a/samples/autoVariables/good.c b/samples/autoVariables/good.c index 61cb17e42..6e74a8e6d 100644 --- a/samples/autoVariables/good.c +++ b/samples/autoVariables/good.c @@ -9,4 +9,5 @@ int main() int b; int *c = &b; foo(&c); + return 0; } diff --git a/samples/outOfBounds/bad.c b/samples/outOfBounds/bad.c index b34db614c..e52bdb6a1 100644 --- a/samples/outOfBounds/bad.c +++ b/samples/outOfBounds/bad.c @@ -3,4 +3,5 @@ int main() { char str[5]; strcpy(str, "0123456789abcdef"); + return 0; } diff --git a/samples/outOfBounds/good.c b/samples/outOfBounds/good.c index a103928f9..21bcabab1 100644 --- a/samples/outOfBounds/good.c +++ b/samples/outOfBounds/good.c @@ -3,4 +3,5 @@ int main() { char str[10]; snprintf(str, 10, "%s", "abc"); + return 0; } diff --git a/samples/syntaxError/bad.c b/samples/syntaxError/bad.c index 3316e50db..25b30b694 100644 --- a/samples/syntaxError/bad.c +++ b/samples/syntaxError/bad.c @@ -1,5 +1,6 @@ int main() { + return 0; #ifdef A } #endif diff --git a/samples/syntaxError/good.c b/samples/syntaxError/good.c index 0686f8ecb..ecec51baf 100644 --- a/samples/syntaxError/good.c +++ b/samples/syntaxError/good.c @@ -2,4 +2,5 @@ int main() { #ifndef A #endif + return 0; }