Skip to content

Commit 62d90c8

Browse files
author
Ben Avison
committed
Move variable into its own curly-brace scope
IAR generates warning Pe546 'transfer of control bypasses initialization of variable "invInvTag"'.
1 parent caff3b5 commit 62d90c8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/class/usbtmc/usbtmc_device.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,10 @@ bool usbtmcd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint
470470
case STATE_IDLE:
471471
TU_VERIFY(xferred_bytes >= sizeof(usbtmc_msg_generic_t));
472472
msg = (usbtmc_msg_generic_t*)(usbtmc_state.ep_bulk_out_buf);
473-
uint8_t invInvTag = (uint8_t)~(msg->header.bTagInverse);
474-
TU_VERIFY(msg->header.bTag == invInvTag);
473+
{
474+
uint8_t invInvTag = (uint8_t)~(msg->header.bTagInverse);
475+
TU_VERIFY(msg->header.bTag == invInvTag);
476+
}
475477
TU_VERIFY(msg->header.bTag != 0x00);
476478

477479
switch(msg->header.MsgID) {

0 commit comments

Comments
 (0)