RTEMS | cpukit/error: Make RTEMS_ERROR_* shifts 16-bit host clean (!1069)
Gedare Bloom (@gedare)
gitlab at rtems.org
Mon Feb 23 16:13:04 UTC 2026
Gedare Bloom started a new discussion on cpukit/include/rtems/error.h: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1069#note_143308
> +/*
> + * Define Error Flags
> + */
> +#define RTEMS_ERROR_BITS (sizeof(rtems_error_code_t) * CHAR_BIT)
> +
> +#define RTEMS_ERROR_ERRNO ( (rtems_error_code_t) 1 << ( RTEMS_ERROR_BITS - 2 ) )
> +
> +#define RTEMS_ERROR_PANIC (RTEMS_ERROR_ERRNO >> 1)
> +#define RTEMS_ERROR_ABORT (RTEMS_ERROR_ERRNO >> 2)
> +
> +
> +#define RTEMS_ERROR_MASK (RTEMS_ERROR_ERRNO | RTEMS_ERROR_PANIC | RTEMS_ERROR_ABORT)
>
> -#define RTEMS_ERROR_MASK \
> - (RTEMS_ERROR_ERRNO | RTEMS_ERROR_ABORT | RTEMS_ERROR_PANIC) /* all */
>
Tighten this up, we don't need the spaces between the macros.
And in general we never want more than 1 blank line in a row in C code.
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1069#note_143308
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260223/983e63df/attachment-0001.htm>
More information about the bugs
mailing list