[PATCH 2/2] cpukit/dev/can: Fix 64 bit build compilation warnings

Gedare Bloom gedare at rtems.org
Wed Dec 14 21:29:56 UTC 2022


On Sat, Dec 3, 2022 at 2:02 AM Prashanth S <fishesprashanth at gmail.com> wrote:
>
> ---
>  cpukit/dev/can/can.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/cpukit/dev/can/can.c b/cpukit/dev/can/can.c
> index 7098ce16c2..2462df7e25 100644
> --- a/cpukit/dev/can/can.c
> +++ b/cpukit/dev/can/can.c
> @@ -204,7 +204,7 @@ static ssize_t can_bus_read(rtems_libio_t *iop, void *buffer, size_t count)
>
>    if (count < len) {
>      CAN_DEBUG("can_bus_read: buffer size is small min sizeof(struct can_msg) = %u\n",
> -                    sizeof(struct can_msg));
> +                    (uint32_t)sizeof(struct can_msg));

If you use the uint32_t, then you should also use the PRIu32 macro instead of %u

>      return -RTEMS_INVALID_SIZE;
>    }
>
> --
> 2.25.1
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel


More information about the devel mailing list