cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_PCD compiled signed unsigned comparison warnings

a34fheuak
Associate II

If you compile stm32f4xx_hal_pcd.c with -Wall, you will get signed/unsigned comparison warnings.

Most of them seem minor, however, in line 1299 they do the following:

int32_t len;
..
if(len <= 0U)
{
    fifoemptymsk = 0x1U << epnum;
    USBx_DEVICE->DIEPEMPMSK &= ~fifoemptymsk;
}

Here, len gets automatically promoted to uint32_t so that it can never be smaller than 0.

Should the comparison be against signed 0, instead of unsigned 0?

1 REPLY 1

In latest version V1.24 of F4 HAL library there is not such code in line 1299.

Try download latest version.