Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
P99 - macros and functions for C99
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
GitLab upgrade completed. Current version is 17.11.3.
Show more breadcrumbs
Jens Gustedt
P99 - macros and functions for C99
Commits
93660e5d
Commit
93660e5d
authored
13 years ago
by
Jens Gustedt
Browse files
Options
Downloads
Patches
Plain Diff
correct two bare returns from protected blocks
parent
5e4e56fc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test-p99-block.c
+7
-0
7 additions, 0 deletions
tests/test-p99-block.c
with
7 additions
and
0 deletions
tests/test-p99-block.c
+
7
−
0
View file @
93660e5d
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment