projects
/
platform
/
upstream
/
libatomic_ops.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8fd0719
)
Workaround 'uninitialized variable' cppcheck error in hpc/hppa.h
author
Ivan Maidanski
<ivmai@mail.ru>
Mon, 24 Apr 2017 17:26:38 +0000
(20:26 +0300)
committer
Ivan Maidanski
<ivmai@mail.ru>
Mon, 24 Apr 2017 17:26:38 +0000
(20:26 +0300)
* src/atomic_ops/sysdeps/hpc/hppa.h [CPPCHECK] (AO_test_and_set_full):
Initialize "ret" local variable (to zero) before AO_ldcw call; add
comment.
src/atomic_ops/sysdeps/hpc/hppa.h
patch
|
blob
|
history
diff --git
a/src/atomic_ops/sysdeps/hpc/hppa.h
b/src/atomic_ops/sysdeps/hpc/hppa.h
index
f2f1dcf
..
27f3fa7
100644
(file)
--- a/
src/atomic_ops/sysdeps/hpc/hppa.h
+++ b/
src/atomic_ops/sysdeps/hpc/hppa.h
@@
-80,6
+80,9
@@
AO_test_and_set_full(volatile AO_TS_t * addr)
register unsigned int ret;
register unsigned long a = (unsigned long)AO_ldcw_align(addr);
+# if defined(CPPCHECK)
+ ret = 0; /* to void 'uninitialized variable' warning */
+# endif
AO_ldcw(a, ret);
return (AO_TS_VAL_t)ret;
}