zephyrproject-rtos / openocd

OpenOCD with Zephyr patches for building Zephyr SDK
Other
28 stars 45 forks source link

Calloc warning/error #62

Open R055A opened 1 month ago

R055A commented 1 month ago

There is a calloc warning/error returned from line 1487 in src/jtag/drivers/ulink.c:

tdo_buffer_start = calloc(sizeof(uint8_t), scan_size_bytes);

The error causes a warning message but this can and is treated as an error, as follows:

Error: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument`

A suggested fix is:

tdo_buffer_start = calloc(scan_size_bytes, sizeof(uint8_t));