Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 93660e5d authored by Jens Gustedt's avatar Jens Gustedt
Browse files

correct two bare returns from protected blocks

parent 5e4e56fc
No related branches found
No related tags found
No related merge requests found
...@@ -53,6 +53,9 @@ P99_XCASE ENOMEM : ...@@ -53,6 +53,9 @@ P99_XCASE ENOMEM :
P99_XDEFAULT : { P99_XDEFAULT : {
fprintf(stderr, "AUTSCH: call to schnoeck failed with unhandled case!\n"); fprintf(stderr, "AUTSCH: call to schnoeck failed with unhandled case!\n");
perror("AUTSCH"); perror("AUTSCH");
/* This is a return that should be triggered as dangerous when
this code is compiled with P99_CHECK_RETURN. */
return EXIT_FAILURE;
} }
} }
...@@ -68,6 +71,10 @@ P99_XDEFAULT : { ...@@ -68,6 +71,10 @@ P99_XDEFAULT : {
P99_PROTECT: { P99_PROTECT: {
printf("cleanup level %u, code %d\n", p99_unwind_level, p99_unwind_code); printf("cleanup level %u, code %d\n", p99_unwind_level, p99_unwind_code);
free(b); free(b);
/* This is a return that is protected, so it should *not* be
triggered as dangerous when this code is compiled with
P99_CHECK_RETURN. */
return EXIT_SUCCESS;
} }
} }
printf("before cleanup level %u, code %d\n", p99_unwind_level, p99_unwind_code); printf("before cleanup level %u, code %d\n", p99_unwind_level, p99_unwind_code);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment