Project

General

Profile

Bug #10334

cleanup smatch errors in usr/src/lib/fm/topo/libtopo

Added by Rob Johnston about 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Start date:
2019-02-01
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Currently smatch checking is disabled for usr/src/lib/fm/topo/libtopo. If you un it on, the following smatch issues are reported:

/export/home/rejohnst/ws/illumos-upstream1/usr/src/tools/proto/root_i386-nd/opt/onbld/bin/i386/smatch: ../common/topo_2xml.c:207 txml_print_prop() error: snprintf() chops off the last chars of '"uint32_array"': 13 vs 10
/export/home/rejohnst/ws/illumos-upstream1/usr/src/tools/proto/root_i386-nd/opt/onbld/bin/i386/smatch: ../common/topo_2xml.c:207 txml_print_prop() error: snprintf() chops off the last chars of '"uint32_array"': 13 vs 10
/export/home/rejohnst/ws/illumos-upstream1/usr/src/tools/proto/root_i386-nd/opt/onbld/bin/i386/smatch: ../common/topo_2xml.c:239 txml_print_pgroup() warn: sizeof(NUMBER)?
/export/home/rejohnst/ws/illumos-upstream1/usr/src/tools/proto/root_i386-nd/opt/onbld/bin/i386/smatch: ../common/topo_2xml.c:265 txml_print_node() warn: sizeof(NUMBER)?
/export/home/rejohnst/ws/illumos-upstream1/usr/src/tools/proto/root_i386-nd/opt/onbld/bin/i386/smatch: ../common/topo_2xml.c:285 txml_print_range() warn: sizeof(NUMBER)?
/export/home/rejohnst/ws/illumos-upstream1/usr/src/tools/proto/root_i386-nd/opt/onbld/bin/i386/smatch: ../common/topo_2xml.c:286 txml_print_range() warn: sizeof(NUMBER)?
/export/home/rejohnst/ws/illumos-upstream1/usr/src/tools/proto/root_i386-nd/opt/onbld/bin/i386/smatch: ../common/topo_2xml.c:239 txml_print_pgroup() warn: sizeof(NUMBER)?
/export/home/rejohnst/ws/illumos-upstream1/usr/src/tools/proto/root_i386-nd/opt/onbld/bin/i386/smatch: ../common/topo_2xml.c:265 txml_print_node() warn: sizeof(NUMBER)?
/export/home/rejohnst/ws/illumos-upstream1/usr/src/tools/proto/root_i386-nd/opt/onbld/bin/i386/smatch: ../common/topo_2xml.c:285 txml_print_range() warn: sizeof(NUMBER)?
/export/home/rejohnst/ws/illumos-upstream1/usr/src/tools/proto/root_i386-nd/opt/onbld/bin/i386/smatch: ../common/topo_2xml.c:286 txml_print_range() warn: sizeof(NUMBER)?
/export/home/rejohnst/ws/illumos-upstream1/usr/src/tools/proto/root_i386-nd/opt/onbld/bin/i386/smatch: ../common/topo_mod.c:477 topo_mod_memfmri() warn: inconsistent indenting
/export/home/rejohnst/ws/illumos-upstream1/usr/src/tools/proto/root_i386-nd/opt/onbld/bin/i386/smatch: ../common/topo_module.c:125 topo_mod_stop() error: unchecked function return 'mod->tm_mops->mop_fini'
/export/home/rejohnst/ws/illumos-upstream1/usr/src/tools/proto/root_i386-nd/opt/onbld/bin/i386/smatch: ../common/topo_module.c:184 topo_mod_destroy() warn: variable dereferenced before check 'mod' (see line 182)
/export/home/rejohnst/ws/illumos-upstream1/usr/src/tools/proto/root_i386-nd/opt/onbld/bin/i386/smatch: ../common/topo_node.c:136 topo_node_destroy() warn: variable dereferenced before check 'node' (see line 132)
/export/home/rejohnst/ws/illumos-upstream1/usr/src/tools/proto/root_i386-nd/opt/onbld/bin/i386/smatch: ../common/topo_subr.c:168 topo_debug_set() warn: if statement not indented

Ths issue is to covery addressing all of the above issues and then modifying the libtopo's makefile to enable match for this directory going forward.

Also available in: Atom PDF