Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clang tidy uninitialized.Branch #17647

Merged
merged 2 commits into from
Apr 25, 2022

Conversation

andy31415
Copy link
Contributor

Problem

Enable more clang-tidy checks to make sure our code is safe.

Change overview

enable clang-tidy check for uninitialized values used for branching.
Fixes one instance of this.

Testing

Ran clang-tidy locally on chip-tool on linux. CI will run more (specifically darwin code as well)

@github-actions
Copy link

github-actions bot commented Apr 22, 2022

PR #17647: Size comparison from 70a499d to bd1d6af

Increases (6 builds for efr32, linux)
platform target config section 70a499d bd1d6af change % change
efr32 window-app BRD4161A (read only) 843268 843284 16 0.0
.text 843260 843276 16 0.0
linux bridge-app debug+rpc (read only) 1841901 1841917 16 0.0
.text 1573941 1573957 16 0.0
lock-app debug (read only) 2145881 2145897 16 0.0
.text 1799442 1799458 16 0.0
shell debug (read only) 2554569 2554585 16 0.0
.text 2177346 2177362 16 0.0
thermostat-no-ble arm64 (read only) 2361404 2361420 16 0.0
.text 1987200 1987216 16 0.0
tv-app debug (read only) 2837569 2837585 16 0.0
.text 2439858 2439874 16 0.0
Full report (32 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section 70a499d bd1d6af change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 690975 690975 0 0.0
(read/write) 161952 161952 0 0.0
.bss 75912 75912 0 0.0
.data 3396 3396 0 0.0
.rodata 106015 106015 0 0.0
.text 584480 584480 0 0.0
lock-ftd LP_CC2652R7 (read only) 677347 677347 0 0.0
(read/write) 166548 166548 0 0.0
.bss 73936 73936 0 0.0
.data 3220 3220 0 0.0
.rodata 98787 98787 0 0.0
.text 578076 578076 0 0.0
lock-mtd LP_CC2652R7 (read only) 626099 626099 0 0.0
(read/write) 146732 146732 0 0.0
.bss 69656 69656 0 0.0
.data 3220 3220 0 0.0
.rodata 98667 98667 0 0.0
.text 526940 526940 0 0.0
pump-app LP_CC2652R7 (read only) 649167 649167 0 0.0
(read/write) 152500 152500 0 0.0
.bss 74368 74368 0 0.0
.data 3252 3252 0 0.0
.rodata 75351 75351 0 0.0
.text 573328 573328 0 0.0
pump-controller-app LP_CC2652R7 (read only) 642155 642155 0 0.0
(read/write) 151912 151912 0 0.0
.bss 74072 74072 0 0.0
.data 3216 3216 0 0.0
.rodata 78491 78491 0 0.0
.text 563176 563176 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 618134 618134 0 0.0
.app_xip_area 525140 525140 0 0.0
.bss 75652 75652 0 0.0
.data 692 692 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 613082 613082 0 0.0
.app_xip_area 521568 521568 0 0.0
.bss 74204 74204 0 0.0
.data 656 656 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 565726 565726 0 0.0
.app_xip_area 464624 464624 0 0.0
.bss 83496 83496 0 0.0
.data 568 568 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 905796 905796 0 0.0
(read/write) 129380 129380 0 0.0
.bss 127336 127336 0 0.0
.data 2044 2044 0 0.0
.text 905788 905788 0 0.0
BRD4161A+rpc (read only) 940196 940196 0 0.0
(read/write) 146064 146064 0 0.0
.bss 143816 143816 0 0.0
.data 2248 2248 0 0.0
.text 940188 940188 0 0.0
window-app BRD4161A (read only) 843268 843284 16 0.0
(read/write) 127468 127468 0 0.0
.bss 125512 125512 0 0.0
.data 1956 1956 0 0.0
.text 843260 843276 16 0.0
esp32 all-clusters-app c3devkit (read only) 997990 997990 0 0.0
(read/write) 1468074 1468074 0 0.0
.dram0.bss 62640 62640 0 0.0
.dram0.data 14428 14428 0 0.0
.flash.rodata 206560 206560 0 0.0
.flash.text 997990 997990 0 0.0
.iram0.text 62020 62020 0 0.0
m5stack (read only) 1052195 1052195 0 0.0
(read/write) 470080 470080 0 0.0
.dram0.bss 68160 68160 0 0.0
.dram0.data 34168 34168 0 0.0
.flash.rodata 235916 235916 0 0.0
.flash.text 1046811 1046811 0 0.0
.iram0.text 123107 123107 0 0.0
k32w light k32w061+release (read/write) 684128 684128 0 0.0
.bss 77656 77656 0 0.0
.data 2000 2000 0 0.0
.text 598672 598672 0 0.0
lock k32w061+release (read/write) 725220 725220 0 0.0
.bss 78288 78288 0 0.0
.data 1960 1960 0 0.0
.text 639172 639172 0 0.0
linux all-clusters-app debug (read only) 2728041 2728041 0 0.0
(read/write) 149600 149600 0 0.0
.bss 59936 59936 0 0.0
.data 1984 1984 0 0.0
.data.rel.ro 81624 81624 0 0.0
.dynamic 608 608 0 0.0
.got 4448 4448 0 0.0
.init 27 27 0 0.0
.init_array 984 984 0 0.0
.rodata 233221 233221 0 0.0
.text 2320098 2320098 0 0.0
bridge-app debug+rpc (read only) 1841901 1841917 16 0.0
(read/write) 91984 91984 0 0.0
.bss 44136 44136 0 0.0
.data 3072 3072 0 0.0
.data.rel.ro 39704 39704 0 0.0
.dynamic 592 592 0 0.0
.got 3920 3920 0 0.0
.init 27 27 0 0.0
.init_array 544 544 0 0.0
.rodata 148961 148961 0 0.0
.text 1573941 1573957 16 0.0
chip-tool debug (read only) 10933925 10933925 0 0.0
(read/write) 375728 375728 0 0.0
.bss 22592 22592 0 0.0
.data 1136 1136 0 0.0
.data.rel.ro 345768 345768 0 0.0
.dynamic 624 624 0 0.0
.got 4936 4936 0 0.0
.init 27 27 0 0.0
.init_array 648 648 0 0.0
.rodata 546421 546421 0 0.0
.text 9547781 9547781 0 0.0
chip-tool-no-interactive-ipv6only arm64 (read only) 10546108 10546108 0 0.0
(read/write) 497633 497633 0 0.0
.bss 40865 40865 0 0.0
.data 1192 1192 0 0.0
.data.rel.ro 393088 393088 0 0.0
.dynamic 560 560 0 0.0
.got 58680 58680 0 0.0
.init 24 24 0 0.0
.init_array 184 184 0 0.0
.rodata 520316 520316 0 0.0
.text 8908132 8908132 0 0.0
lighting-app debug+rpc (read only) 2319369 2319369 0 0.0
(read/write) 128048 128048 0 0.0
.bss 50016 50016 0 0.0
.data 1984 1984 0 0.0
.data.rel.ro 70328 70328 0 0.0
.dynamic 608 608 0 0.0
.got 4304 4304 0 0.0
.init 27 27 0 0.0
.init_array 776 776 0 0.0
.rodata 183121 183121 0 0.0
.text 1969730 1969730 0 0.0
lock-app debug (read only) 2145881 2145897 16 0.0
(read/write) 120280 120280 0 0.0
.bss 47808 47808 0 0.0
.data 1504 1504 0 0.0
.data.rel.ro 65368 65368 0 0.0
.dynamic 592 592 0 0.0
.got 4264 4264 0 0.0
.init 27 27 0 0.0
.init_array 720 720 0 0.0
.rodata 189441 189441 0 0.0
.text 1799442 1799458 16 0.0
ota-provider-app debug (read only) 2052473 2052473 0 0.0
(read/write) 115648 115648 0 0.0
.bss 48000 48000 0 0.0
.data 1672 1672 0 0.0
.data.rel.ro 60216 60216 0 0.0
.dynamic 608 608 0 0.0
.got 4464 4464 0 0.0
.init 27 27 0 0.0
.init_array 632 632 0 0.0
.rodata 173595 173595 0 0.0
.text 1721634 1721634 0 0.0
ota-requestor-app debug (read only) 2083689 2083689 0 0.0
(read/write) 118456 118456 0 0.0
.bss 48672 48672 0 0.0
.data 1928 1928 0 0.0
.data.rel.ro 62248 62248 0 0.0
.dynamic 592 592 0 0.0
.got 4304 4304 0 0.0
.init 27 27 0 0.0
.init_array 656 656 0 0.0
.rodata 169916 169916 0 0.0
.text 1755042 1755042 0 0.0
shell debug (read only) 2554569 2554585 16 0.0
(read/write) 150376 150376 0 0.0
.bss 67336 67336 0 0.0
.data 1360 1360 0 0.0
.data.rel.ro 75952 75952 0 0.0
.dynamic 592 592 0 0.0
.got 4168 4168 0 0.0
.init 27 27 0 0.0
.init_array 920 920 0 0.0
.rodata 215410 215410 0 0.0
.text 2177346 2177362 16 0.0
thermostat-no-ble arm64 (read only) 2361404 2361420 16 0.0
(read/write) 151137 151137 0 0.0
.bss 62897 62897 0 0.0
.data 1488 1488 0 0.0
.data.rel.ro 78992 78992 0 0.0
.dynamic 560 560 0 0.0
.got 4744 4744 0 0.0
.init 24 24 0 0.0
.init_array 368 368 0 0.0
.rodata 145164 145164 0 0.0
.text 1987200 1987216 16 0.0
tv-app debug (read only) 2837569 2837585 16 0.0
(read/write) 253360 253360 0 0.0
.bss 165944 165944 0 0.0
.data 4640 4640 0 0.0
.data.rel.ro 76560 76560 0 0.0
.dynamic 592 592 0 0.0
.got 4680 4680 0 0.0
.init 27 27 0 0.0
.init_array 912 912 0 0.0
.rodata 215371 215371 0 0.0
.text 2439858 2439874 16 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2410108 2410108 0 0.0
.bss 184996 184996 0 0.0
.data 5848 5848 0 0.0
.text 1372708 1372708 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1170627 1170627 0 0.0
bss 136264 136264 0 0.0
rodata 150052 150052 0 0.0
text 805664 805664 0 0.0
p6 all-clusters-app default (read/write) 2525168 2525168 0 0.0
.bss 118376 118376 0 0.0
.data 2784 2784 0 0.0
.text 1483432 1483432 0 0.0
light-app default (read/write) 2416936 2416936 0 0.0
.bss 111856 111856 0 0.0
.data 2584 2584 0 0.0
.text 1375200 1375200 0 0.0
lock-app default (read/write) 2421112 2421112 0 0.0
.bss 111656 111656 0 0.0
.data 2544 2544 0 0.0
.text 1379376 1379376 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 801048 801048 0 0.0
bss 69696 69696 0 0.0
noinit 40416 40416 0 0.0
text 570394 570394 0 0.0

@boring-cyborg boring-cyborg bot added the lib label Apr 22, 2022
@github-actions
Copy link

github-actions bot commented Apr 22, 2022

PR #17647: Size comparison from 70a499d to e1cc8a4

Increases (6 builds for efr32, linux)
platform target config section 70a499d e1cc8a4 change % change
efr32 window-app BRD4161A (read only) 843268 843284 16 0.0
.text 843260 843276 16 0.0
linux bridge-app debug+rpc (read only) 1841901 1841917 16 0.0
.text 1573941 1573957 16 0.0
lock-app debug (read only) 2145881 2145897 16 0.0
.text 1799442 1799458 16 0.0
shell debug (read only) 2554569 2554585 16 0.0
.text 2177346 2177362 16 0.0
thermostat-no-ble arm64 (read only) 2361404 2361420 16 0.0
.text 1987200 1987216 16 0.0
tv-app debug (read only) 2837569 2837585 16 0.0
.text 2439858 2439874 16 0.0
Full report (32 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section 70a499d e1cc8a4 change % change
cc13x2_26x2 all-clusters-app LP_CC2652R7 (read only) 690975 690975 0 0.0
(read/write) 161952 161952 0 0.0
.bss 75912 75912 0 0.0
.data 3396 3396 0 0.0
.rodata 106015 106015 0 0.0
.text 584480 584480 0 0.0
lock-ftd LP_CC2652R7 (read only) 677347 677347 0 0.0
(read/write) 166548 166548 0 0.0
.bss 73936 73936 0 0.0
.data 3220 3220 0 0.0
.rodata 98787 98787 0 0.0
.text 578076 578076 0 0.0
lock-mtd LP_CC2652R7 (read only) 626099 626099 0 0.0
(read/write) 146732 146732 0 0.0
.bss 69656 69656 0 0.0
.data 3220 3220 0 0.0
.rodata 98667 98667 0 0.0
.text 526940 526940 0 0.0
pump-app LP_CC2652R7 (read only) 649167 649167 0 0.0
(read/write) 152500 152500 0 0.0
.bss 74368 74368 0 0.0
.data 3252 3252 0 0.0
.rodata 75351 75351 0 0.0
.text 573328 573328 0 0.0
pump-controller-app LP_CC2652R7 (read only) 642155 642155 0 0.0
(read/write) 151912 151912 0 0.0
.bss 74072 74072 0 0.0
.data 3216 3216 0 0.0
.rodata 78491 78491 0 0.0
.text 563176 563176 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 618134 618134 0 0.0
.app_xip_area 525140 525140 0 0.0
.bss 75652 75652 0 0.0
.data 692 692 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 613082 613082 0 0.0
.app_xip_area 521568 521568 0 0.0
.bss 74204 74204 0 0.0
.data 656 656 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 565726 565726 0 0.0
.app_xip_area 464624 464624 0 0.0
.bss 83496 83496 0 0.0
.data 568 568 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 905796 905796 0 0.0
(read/write) 129380 129380 0 0.0
.bss 127336 127336 0 0.0
.data 2044 2044 0 0.0
.text 905788 905788 0 0.0
BRD4161A+rpc (read only) 940196 940196 0 0.0
(read/write) 146064 146064 0 0.0
.bss 143816 143816 0 0.0
.data 2248 2248 0 0.0
.text 940188 940188 0 0.0
window-app BRD4161A (read only) 843268 843284 16 0.0
(read/write) 127468 127468 0 0.0
.bss 125512 125512 0 0.0
.data 1956 1956 0 0.0
.text 843260 843276 16 0.0
esp32 all-clusters-app c3devkit (read only) 997990 997990 0 0.0
(read/write) 1468074 1468074 0 0.0
.dram0.bss 62640 62640 0 0.0
.dram0.data 14428 14428 0 0.0
.flash.rodata 206560 206560 0 0.0
.flash.text 997990 997990 0 0.0
.iram0.text 62020 62020 0 0.0
m5stack (read only) 1052195 1052195 0 0.0
(read/write) 470080 470080 0 0.0
.dram0.bss 68160 68160 0 0.0
.dram0.data 34168 34168 0 0.0
.flash.rodata 235916 235916 0 0.0
.flash.text 1046811 1046811 0 0.0
.iram0.text 123107 123107 0 0.0
k32w light k32w061+release (read/write) 684128 684128 0 0.0
.bss 77656 77656 0 0.0
.data 2000 2000 0 0.0
.text 598672 598672 0 0.0
lock k32w061+release (read/write) 725220 725220 0 0.0
.bss 78288 78288 0 0.0
.data 1960 1960 0 0.0
.text 639172 639172 0 0.0
linux all-clusters-app debug (read only) 2728041 2728041 0 0.0
(read/write) 149600 149600 0 0.0
.bss 59936 59936 0 0.0
.data 1984 1984 0 0.0
.data.rel.ro 81624 81624 0 0.0
.dynamic 608 608 0 0.0
.got 4448 4448 0 0.0
.init 27 27 0 0.0
.init_array 984 984 0 0.0
.rodata 233221 233221 0 0.0
.text 2320098 2320098 0 0.0
bridge-app debug+rpc (read only) 1841901 1841917 16 0.0
(read/write) 91984 91984 0 0.0
.bss 44136 44136 0 0.0
.data 3072 3072 0 0.0
.data.rel.ro 39704 39704 0 0.0
.dynamic 592 592 0 0.0
.got 3920 3920 0 0.0
.init 27 27 0 0.0
.init_array 544 544 0 0.0
.rodata 148961 148961 0 0.0
.text 1573941 1573957 16 0.0
chip-tool debug (read only) 10933925 10933925 0 0.0
(read/write) 375728 375728 0 0.0
.bss 22592 22592 0 0.0
.data 1136 1136 0 0.0
.data.rel.ro 345768 345768 0 0.0
.dynamic 624 624 0 0.0
.got 4936 4936 0 0.0
.init 27 27 0 0.0
.init_array 648 648 0 0.0
.rodata 546421 546421 0 0.0
.text 9547781 9547781 0 0.0
chip-tool-no-interactive-ipv6only arm64 (read only) 10546108 10546108 0 0.0
(read/write) 497633 497633 0 0.0
.bss 40865 40865 0 0.0
.data 1192 1192 0 0.0
.data.rel.ro 393088 393088 0 0.0
.dynamic 560 560 0 0.0
.got 58680 58680 0 0.0
.init 24 24 0 0.0
.init_array 184 184 0 0.0
.rodata 520316 520316 0 0.0
.text 8908132 8908132 0 0.0
lighting-app debug+rpc (read only) 2319369 2319369 0 0.0
(read/write) 128048 128048 0 0.0
.bss 50016 50016 0 0.0
.data 1984 1984 0 0.0
.data.rel.ro 70328 70328 0 0.0
.dynamic 608 608 0 0.0
.got 4304 4304 0 0.0
.init 27 27 0 0.0
.init_array 776 776 0 0.0
.rodata 183121 183121 0 0.0
.text 1969730 1969730 0 0.0
lock-app debug (read only) 2145881 2145897 16 0.0
(read/write) 120280 120280 0 0.0
.bss 47808 47808 0 0.0
.data 1504 1504 0 0.0
.data.rel.ro 65368 65368 0 0.0
.dynamic 592 592 0 0.0
.got 4264 4264 0 0.0
.init 27 27 0 0.0
.init_array 720 720 0 0.0
.rodata 189441 189441 0 0.0
.text 1799442 1799458 16 0.0
ota-provider-app debug (read only) 2052473 2052473 0 0.0
(read/write) 115648 115648 0 0.0
.bss 48000 48000 0 0.0
.data 1672 1672 0 0.0
.data.rel.ro 60216 60216 0 0.0
.dynamic 608 608 0 0.0
.got 4464 4464 0 0.0
.init 27 27 0 0.0
.init_array 632 632 0 0.0
.rodata 173595 173595 0 0.0
.text 1721634 1721634 0 0.0
ota-requestor-app debug (read only) 2083689 2083689 0 0.0
(read/write) 118456 118456 0 0.0
.bss 48672 48672 0 0.0
.data 1928 1928 0 0.0
.data.rel.ro 62248 62248 0 0.0
.dynamic 592 592 0 0.0
.got 4304 4304 0 0.0
.init 27 27 0 0.0
.init_array 656 656 0 0.0
.rodata 169916 169916 0 0.0
.text 1755042 1755042 0 0.0
shell debug (read only) 2554569 2554585 16 0.0
(read/write) 150376 150376 0 0.0
.bss 67336 67336 0 0.0
.data 1360 1360 0 0.0
.data.rel.ro 75952 75952 0 0.0
.dynamic 592 592 0 0.0
.got 4168 4168 0 0.0
.init 27 27 0 0.0
.init_array 920 920 0 0.0
.rodata 215410 215410 0 0.0
.text 2177346 2177362 16 0.0
thermostat-no-ble arm64 (read only) 2361404 2361420 16 0.0
(read/write) 151137 151137 0 0.0
.bss 62897 62897 0 0.0
.data 1488 1488 0 0.0
.data.rel.ro 78992 78992 0 0.0
.dynamic 560 560 0 0.0
.got 4744 4744 0 0.0
.init 24 24 0 0.0
.init_array 368 368 0 0.0
.rodata 145164 145164 0 0.0
.text 1987200 1987216 16 0.0
tv-app debug (read only) 2837569 2837585 16 0.0
(read/write) 253360 253360 0 0.0
.bss 165944 165944 0 0.0
.data 4640 4640 0 0.0
.data.rel.ro 76560 76560 0 0.0
.dynamic 592 592 0 0.0
.got 4680 4680 0 0.0
.init 27 27 0 0.0
.init_array 912 912 0 0.0
.rodata 215371 215371 0 0.0
.text 2439858 2439874 16 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2410108 2410108 0 0.0
.bss 184996 184996 0 0.0
.data 5848 5848 0 0.0
.text 1372708 1372708 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1170627 1170627 0 0.0
bss 136264 136264 0 0.0
rodata 150052 150052 0 0.0
text 805664 805664 0 0.0
p6 all-clusters-app default (read/write) 2525168 2525168 0 0.0
.bss 118376 118376 0 0.0
.data 2784 2784 0 0.0
.text 1483432 1483432 0 0.0
light-app default (read/write) 2416936 2416936 0 0.0
.bss 111856 111856 0 0.0
.data 2584 2584 0 0.0
.text 1375200 1375200 0 0.0
lock-app default (read/write) 2421112 2421112 0 0.0
.bss 111656 111656 0 0.0
.data 2544 2544 0 0.0
.text 1379376 1379376 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 801048 801048 0 0.0
bss 69696 69696 0 0.0
noinit 40416 40416 0 0.0
text 570394 570394 0 0.0

@andy31415 andy31415 merged commit c292484 into project-chip:master Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants