Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
7488705d
Commit
7488705d
authored
Mar 04, 2021
by
lhchavez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add guidelines for the GIT_WARN_UNUSED_RESULT annotation
parent
4bb1568f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletions
+12
-1
include/git2/common.h
+12
-1
No files found.
include/git2/common.h
View file @
7488705d
...
...
@@ -71,7 +71,18 @@ typedef size_t size_t;
# define GIT_FORMAT_PRINTF(a,b)
/* empty */
#endif
/** Declare that a function's return value must be used. */
/**
* Declare that a function's return value must be used.
*
* Used mostly to guard against potential silent bugs at runtime. This is
* recommended to be added to functions that:
*
* - Allocate / reallocate memory. This prevents memory leaks or errors where
* buffers are expected to have grown to a certain size, but could not be
* resized.
* - Acquire locks. When a lock cannot be acquired, that will almost certainly
* cause a data race / undefined behavior.
*/
#if defined(__GNUC__)
# define GIT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment