- **status**: review --> fixed
- **Comment**:

changeset:   7736:e99205cf405d
user:        Anders Widell <a...@..com>
date:        Tue Jun 21 15:16:08 2016 +0200
summary:     build: Update cppcheck target options [#1879]

changeset:   7737:d885eddf345f
user:        Anders Widell <a...@..com>
date:        Tue Jun 21 15:16:15 2016 +0200
summary:     amf: Remove unused info_size patricia tree parameter [#1879]

changeset:   7738:062f738c1cf1
user:        Anders Widell <a...@..com>
date:        Tue Jun 21 15:16:21 2016 +0200
summary:     lck: Remove unused info_size patricia tree parameter [#1879]

changeset:   7739:9d8bb6f6d055
user:        Anders Widell <a...@..com>
date:        Tue Jun 21 15:21:12 2016 +0200
summary:     msg: Remove unused info_size patricia tree parameter [#1879]

changeset:   7740:36dfacb04f88
user:        Anders Widell <a...@..com>
date:        Tue Jun 21 15:21:36 2016 +0200
summary:     plm: Remove unused info_size patricia tree parameter [#1879]

changeset:   7741:492ebe554e61
user:        Anders Widell <a...@..com>
date:        Tue Jun 21 15:21:37 2016 +0200
summary:     base: Fix cppcheck warnings [#1879]

[staging:e99205]
[staging:d885ed]
[staging:062f73]
[staging:9d8bb6]
[staging:36dfac]
[staging:492ebe]




---

** [tickets:#1879] base: Fix cppcheck warnings**

**Status:** fixed
**Milestone:** 5.1.FC
**Created:** Tue Jun 14, 2016 12:53 PM UTC by Anders Widell
**Last Updated:** Wed Jun 15, 2016 02:52 PM UTC
**Owner:** Anders Widell


cppcheck version 1.74 reports the following warnings in the BASE component:

Line | Id | CWE | Severity | Message
---------- | ---------- | ------ | ------ | ------
 | | | | osaf/libs/core/common/daemon.c
212 | variableScope | 398 | style | The scope of the variable 'plibc_prctl' can 
be reduced.
214 | variableScope | 398 | style | The scope of the variable 'pid' can be 
reduced.
214 | variableScope | 398 | style | The scope of the variable 'sid' can be 
reduced.
256 | uninitvar | 908 | error | Uninitialized variable: param
340 | getpwnamCalled |  | portability | Non reentrant function 'getpwnam' 
called. For threadsafe applications it is recommended to use the reentrant 
replacement function 'getpwnam_r'.
505 | variableScope | 398 | style | The scope of the variable 
'bt_filename_size' can be reduced.
507 | variableScope | 398 | style | The scope of the variable 'time_string' can 
be reduced.
510 | variableScope | 398 | style | The scope of the variable 'i' can be 
reduced.
528 | uninitvar | 908 | error | Uninitialized variable: time_string
533 | localtimeCalled |  | portability | Non reentrant function 'localtime' 
called. For threadsafe applications it is recommended to use the reentrant 
replacement function 'localtime_r'.
539 | uninitvar | 908 | error | Uninitialized variable: time_string
 | | | | osaf/libs/core/common/ncs_main_pub.c
129 | unusedStructMember |  | style | struct member 
'ncs_main_pub_cb::lock_create' is never used.
178 | redundantAssignment | 563 | style | Variable 'rc' is reassigned a value 
before the old one has been used.
315 | redundantAssignment | 563 | style | Variable 'rc' is reassigned a value 
before the old one has been used.
693 | unreadVariable |  | style | Variable 'res' is assigned a value that is 
never used.
714 | variableScope | 398 | style | The scope of the variable 'p_field' can be 
reduced.
794 | variableScope | 398 | style | The scope of the variable 'tmp' can be 
reduced.
 | | | | osaf/libs/core/common/nid_start_util.c
54 | invalidscanf |  | warning | fscanf() without field width limits can crash 
with huge input data.
 | | | | osaf/libs/core/common/osaf_extended_name.c
183 | uninitdata | 908 | error | Memory is allocated but not initialized: 
pointer
 | | | | osaf/libs/core/common/osaf_poll.c
117 | uninitvar | 908 | error | Uninitialized variable: elapsed_time
118 | uninitvar | 908 | error | Uninitialized variable: elapsed_time
120 | uninitvar | 908 | error | Uninitialized variable: elapsed_time
134 | uninitvar | 908 | error | Uninitialized variable: set
135 | uninitvar | 908 | error | Uninitialized variable: set
 | | | | osaf/libs/core/common/osaf_secutil.c
82 | uninitvar | 908 | error | Uninitialized variable: fds
83 | uninitvar | 908 | error | Uninitialized variable: fds
136 | uninitvar | 908 | error | Uninitialized variable: unaddr
170 | uninitvar | 908 | error | Uninitialized variable: fds
171 | uninitvar | 908 | error | Uninitialized variable: fds
203 | uninitdata | 908 | error | Memory is allocated but not initialized: fd
243 | getpwuidCalled |  | portability | Non reentrant function 'getpwuid' 
called. For threadsafe applications it is recommended to use the reentrant 
replacement function 'getpwuid_r'.
279 | uninitvar | 908 | error | Uninitialized variable: remote
295 | uninitvar | 908 | error | Uninitialized variable: fds
296 | uninitvar | 908 | error | Uninitialized variable: fds
353 | getpwuidCalled |  | portability | Non reentrant function 'getpwuid' 
called. For threadsafe applications it is recommended to use the reentrant 
replacement function 'getpwuid_r'.
370 | getgrentCalled |  | portability | Non reentrant function 'getgrent' 
called. For threadsafe applications it is recommended to use the reentrant 
replacement function 'getgrent_r'.
379 | getgrentCalled |  | portability | Non reentrant function 'getgrent' 
called. For threadsafe applications it is recommended to use the reentrant 
replacement function 'getgrent_r'.
399 | getgrentCalled |  | portability | Non reentrant function 'getgrent' 
called. For threadsafe applications it is recommended to use the reentrant 
replacement function 'getgrent_r'.
 | | | | osaf/libs/core/common/osaf_timerfd.c
184 | uninitvar | 908 | error | Uninitialized variable: event
185 | uninitvar | 908 | error | Uninitialized variable: event
186 | uninitvar | 908 | error | Uninitialized variable: event
187 | uninitvar | 908 | error | Uninitialized variable: event
 | | | | osaf/libs/core/cplusplus/base/tests/time_compare_test.cc
25 | duplicateExpression | 398 | style | Same expression on both sides of '<'.
26 | duplicateExpression | 398 | style | Same expression on both sides of '<='.
29 | duplicateExpression | 398 | style | Same expression on both sides of '>='.
30 | duplicateExpression | 398 | style | Same expression on both sides of '>'.
70 | duplicateExpression | 398 | style | Same expression on both sides of '<'.
71 | duplicateExpression | 398 | style | Same expression on both sides of '<='.
74 | duplicateExpression | 398 | style | Same expression on both sides of '>='.
75 | duplicateExpression | 398 | style | Same expression on both sides of '>'.
97 | duplicateExpression | 398 | style | Same expression on both sides of '<'.
98 | duplicateExpression | 398 | style | Same expression on both sides of '<='.
101 | duplicateExpression | 398 | style | Same expression on both sides of '>='.
102 | duplicateExpression | 398 | style | Same expression on both sides of '>'.
 | | | | osaf/libs/core/leap/hj_edp.c
169 | variableScope | 398 | style | The scope of the variable 'len' can be 
reduced.
352 | variableScope | 398 | style | The scope of the variable 'len' can be 
reduced.
352 | variableScope | 398 | style | The scope of the variable 'byte_cnt' can be 
reduced.
778 | variableScope | 398 | style | The scope of the variable 'byte_cnt' can be 
reduced.
1661 | sizeofDivisionMemfunc |  | warning | Division by result of sizeof(). 
malloc() expects a size in bytes, did you intend to multiply instead?
1813 | sizeofDivisionMemfunc |  | warning | Division by result of sizeof(). 
malloc() expects a size in bytes, did you intend to multiply instead?
 | | | | osaf/libs/core/leap/hj_edu.c
132 | variableScope | 398 | style | The scope of the variable 'arguments' can 
be reduced.
284 | variableScope | 398 | style | The scope of the variable 'arguments' can 
be reduced.
413 | variableScope | 398 | style | The scope of the variable 'dtype_attrb' can 
be reduced.
415 | variableScope | 398 | style | The scope of the variable 'cnt' can be 
reduced.
445 | uninitvar | 908 | error | Uninitialized variable: admin_op
446 | uninitvar | 908 | error | Uninitialized variable: admin_op
498 | unreadVariable |  | style | Variable 'admin_op' is assigned a value that 
is never used.
2478 | variableScope | 398 | style | The scope of the variable 'lclfnd' can be 
reduced.
2528 | variableScope | 398 | style | The scope of the variable 'already_added' 
can be reduced.
3244 | variableScope | 398 | style | The scope of the variable 'new_node' can 
be reduced.
3296 | uninitvar | 908 | error | Uninitialized variable: list_params
3321 | variableScope | 398 | style | The scope of the variable 'key' can be 
reduced.
3322 | variableScope | 398 | style | The scope of the variable 'pnode' can be 
reduced.
3328 | unreadVariable |  | style | Variable 'lcl_key' is assigned a value that 
is never used.
3447 | variableScope | 398 | style | The scope of the variable 'val' can be 
reduced.
3499 | variableScope | 398 | style | The scope of the variable 'val' can be 
reduced.
3529 | variableScope | 398 | style | The scope of the variable 'i' can be 
reduced.
3626 | variableScope | 398 | style | The scope of the variable 'val' can be 
reduced.
3679 | variableScope | 398 | style | The scope of the variable 'val' can be 
reduced.
 | | | | osaf/libs/core/leap/hj_enc.c
58 | variableScope | 398 | style | The scope of the variable 'p' can be reduced.
 | | | | osaf/libs/core/leap/hj_hdl.c
193 | uninitvar | 908 | error | Uninitialized variable: ha
194 | uninitvar | 908 | error | Uninitialized variable: ha
195 | uninitvar | 908 | error | Uninitialized variable: ha
196 | uninitvar | 908 | error | Uninitialized variable: ha
231 | variableScope | 398 | style | The scope of the variable 'unit' can be 
reduced.
271 | variableScope | 398 | style | The scope of the variable 'cell' can be 
reduced.
311 | variableScope | 398 | style | The scope of the variable 'cell' can be 
reduced.
547 | variableScope | 398 | style | The scope of the variable 'cell' can be 
reduced.
578 | uninitvar | 908 | error | Uninitialized variable: hdl
579 | uninitvar | 908 | error | Uninitialized variable: hdl
580 | uninitvar | 908 | error | Uninitialized variable: hdl
613 | variableScope | 398 | style | The scope of the variable 'cell' can be 
reduced.
617 | variableScope | 398 | style | The scope of the variable 'i' can be 
reduced.
 | | | | osaf/libs/core/leap/hj_tmr.c
389 | variableScope | 398 | style | The scope of the variable 'tmr_info' can be 
reduced.
425 | variableScope | 398 | style | The scope of the variable 'pres_tmr_info' 
can be reduced.
471 | variableScope | 398 | style | The scope of the variable 'prev_tmr_info' 
can be reduced.
 | | | | osaf/libs/core/leap/hj_ubaid.c
708 | variableScope | 398 | style | The scope of the variable 'p' can be 
reduced.
 | | | | osaf/libs/core/leap/os_defs.c
505 | variableScope | 398 | style | The scope of the variable 'tmp_hdl' can be 
reduced.
593 | uninitvar | 908 | error | Uninitialized variable: os_req
595 | uninitvar | 908 | error | Uninitialized variable: os_req
597 | uninitvar | 908 | error | Uninitialized variable: os_req
598 | uninitvar | 908 | error | Uninitialized variable: os_req
599 | uninitvar | 908 | error | Uninitialized variable: os_req
600 | uninitvar | 908 | error | Uninitialized variable: os_req
614 | uninitvar | 908 | error | Uninitialized variable: os_req
616 | uninitvar | 908 | error | Uninitialized variable: os_req
618 | uninitvar | 908 | error | Uninitialized variable: os_req
619 | uninitvar | 908 | error | Uninitialized variable: os_req
620 | uninitvar | 908 | error | Uninitialized variable: os_req
621 | uninitvar | 908 | error | Uninitialized variable: os_req
645 | variableScope | 398 | style | The scope of the variable 'file' can be 
reduced.
654 | uninitvar | 908 | error | Uninitialized variable: os_req
661 | uninitvar | 908 | error | Uninitialized variable: os_req
667 | uninitvar | 908 | error | Uninitialized variable: os_req
670 | uninitvar | 908 | error | Uninitialized variable: os_req
694 | uninitvar | 908 | error | Uninitialized variable: os_req
695 | uninitvar | 908 | error | Uninitialized variable: os_req
696 | uninitvar | 908 | error | Uninitialized variable: os_req
706 | uninitvar | 908 | error | Uninitialized variable: os_req
707 | uninitvar | 908 | error | Uninitialized variable: os_req
773 | variableScope | 398 | style | The scope of the variable 'prot_flag' can 
be reduced.
 | | | | osaf/libs/core/leap/sysf_exc_scr.c
109 | uninitvar | 908 | error | Uninitialized variable: info
110 | uninitvar | 908 | error | Uninitialized variable: info
111 | uninitvar | 908 | error | Uninitialized variable: info
146 | uninitvar | 908 | error | Uninitialized variable: info
147 | uninitvar | 908 | error | Uninitialized variable: info
148 | uninitvar | 908 | error | Uninitialized variable: info
404 | uninitvar | 908 | error | Uninitialized variable: pt_params
460 | variableScope | 398 | style | The scope of the variable 'exec_pid' can be 
reduced.
 | | | | osaf/libs/core/leap/sysf_ipc.c
454 | variableScope | 398 | style | The scope of the variable 'inds_rmvd' can 
be reduced.
 | | | | osaf/libs/core/leap/sysf_mem.c
747 | uninitvar | 908 | error | Uninitialized variable: l_util
854 | variableScope | 398 | style | The scope of the variable 'pub' can be 
reduced.
856 | variableScope | 398 | style | The scope of the variable 'buflen' can be 
reduced.
944 | variableScope | 398 | style | The scope of the variable 'buflen' can be 
reduced.
1162 | variableScope | 398 | style | The scope of the variable 'i' can be 
reduced.
1170 | variableScope | 398 | style | The scope of the variable 'dest' can be 
reduced.
1478 | variableScope | 398 | style | The scope of the variable 'bufsize' can be 
reduced.
1735 | variableScope | 398 | style | The scope of the variable 'len' can be 
reduced.
1736 | variableScope | 398 | style | The scope of the variable 'dst' can be 
reduced.
1917 | variableScope | 398 | style | The scope of the variable 'file' can be 
reduced.
 | | | | osaf/libs/core/leap/sysf_tmr.c
166 | unusedStructMember |  | style | struct member 'sysf_tmr_cb::stats' is 
never used.
390 | variableScope | 398 | style | The scope of the variable 'rc' can be 
reduced.
545 | variableScope | 398 | style | The scope of the variable 'free_tmr' can be 
reduced.
 | | | | osaf/libs/core/leap/sysf_tsk.c
53 | uninitvar | 908 | error | Uninitialized variable: task
54 | uninitvar | 908 | error | Uninitialized variable: task
55 | uninitvar | 908 | error | Uninitialized variable: task
56 | uninitvar | 908 | error | Uninitialized variable: task
57 | uninitvar | 908 | error | Uninitialized variable: task
58 | uninitvar | 908 | error | Uninitialized variable: task
75 | uninitvar | 908 | error | Uninitialized variable: task
87 | uninitvar | 908 | error | Uninitialized variable: task
99 | uninitvar | 908 | error | Uninitialized variable: task
111 | uninitvar | 908 | error | Uninitialized variable: task
123 | uninitvar | 908 | error | Uninitialized variable: task
132 | uninitvar | 908 | error | Uninitialized variable: task
 | | | | osaf/libs/core/leap/tests/sysf_ipc_test.cc
41 | variableScope | 398 | style | The scope of the variable 'temp' can be 
reduced.
74 | redundantAssignment | 563 | style | Variable 'rc' is reassigned a value 
before the old one has been used.
123 | variableScope | 398 | style | The scope of the variable 'msg' can be 
reduced.
124 | variableScope | 398 | style | The scope of the variable 'prio' can be 
reduced.
126 | variableScope | 398 | style | The scope of the variable 'rc' can be 
reduced.
 | | | | osaf/libs/core/leap/tests/sysf_tmr_test.cc
18 | uninitMemberVar | 398 | warning | Member variable 'SysfTmrTest::timers_' 
is not initialized in the constructor.



---

Sent from sourceforge.net because opensaf-tickets@lists.sourceforge.net is 
subscribed to https://sourceforge.net/p/opensaf/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/opensaf/admin/tickets/options.  Or, if this is a 
mailing list, you can unsubscribe from the mailing list.
------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Opensaf-tickets mailing list
Opensaf-tickets@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-tickets

Reply via email to