Skip to content

Commit 6881f96

Browse files
wdfk-progRbb666
authored andcommitted
feat: Initialize local variables to prevent GCC compilation warnings
1 parent 5abce84 commit 6881f96

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

components/drivers/serial/dev_serial_v2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ static rt_ssize_t _serial_fifo_tx_nonblocking(struct rt_device *dev,
747747
{
748748
struct rt_serial_device *serial;
749749
struct rt_serial_tx_fifo *tx_fifo;
750-
rt_uint8_t *put_ptr;
750+
rt_uint8_t *put_ptr = RT_NULL;
751751
rt_base_t level;
752752
rt_size_t send_size;
753753
rt_ssize_t transmit_size;

components/fal/src/fal_rtt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ static void fal(rt_uint8_t argc, char **argv) {
599599
else
600600
{
601601
const char *operator = argv[1];
602-
rt_uint32_t addr, size;
602+
rt_uint32_t addr = 0, size = 0;
603603

604604
if (!strcmp(operator, "probe"))
605605
{

components/utilities/ymodem/ymodem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ static rt_err_t _rym_do_handshake(
204204
enum rym_code code;
205205
rt_size_t i;
206206
rt_uint16_t recv_crc, cal_crc;
207-
rt_size_t data_sz;
207+
rt_size_t data_sz = 0;
208208
rt_tick_t tick;
209209

210210
ctx->stage = RYM_STAGE_ESTABLISHING;

0 commit comments

Comments
 (0)