Skip to content

Commit 2187774

Browse files
committed
vega_sdk_riscv: Ignore GCC warning about potential uninitialized variable
When -ffreestanding is not enabled, and GCC is able to use it's knowledge of memset semantics, it sometimes gets it wrong, as in this case. I'm not quite sure what is confusing it here, but the code sure looks correct. Signed-off-by: Keith Packard <[email protected]>
1 parent 40d049f commit 2187774

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

vega_sdk_riscv/devices/RV32M1/drivers/fsl_cau3_ble.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4077,6 +4077,9 @@ status_t CAU3_CHACHA20_POLY1305_SetKey(CAU3_Type *base, cau3_handle_t *handle, c
40774077

40784078
static status_t cau3_load_nonce(CAU3_Type *base, const uint8_t *nonce, cau3_key_slot_t keySlot)
40794079
{
4080+
#pragma GCC diagnostic push
4081+
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
4082+
40804083
union {
40814084
uint8_t b[16];
40824085
uint32_t w[4];
@@ -4092,6 +4095,7 @@ static status_t cau3_load_nonce(CAU3_Type *base, const uint8_t *nonce, cau3_key_
40924095
tempIv.w[2] = __REV(tempIv.w[2]);
40934096

40944097
return CAU3_LoadKeyInitVector(base, tempIv.b, keySlot, kCAU3_TaskDonePoll);
4098+
#pragma GCC diagnostic pop
40954099
}
40964100

40974101
status_t CAU3_CHACHA20_POLY1305_Encrypt(CAU3_Type *base,

0 commit comments

Comments
 (0)