[PATCH 1/2] config: Simplify task stack allocator init

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Nov 19 15:37:41 UTC 2020


On 19/11/2020 08:41, Sebastian Huber wrote:

> +  RTEMS_STATIC_ASSERT(
> +    CONFIGURE_TASK_STACK_ALLOCATOR != NULL,
> +    CONFIGURE_TASK_STACK_ALLOCATOR_MUST_NOT_BE_NULL
> +  );
> +
>     const Stack_Allocator_allocate _Stack_Allocator_allocate =
>       CONFIGURE_TASK_STACK_ALLOCATOR;

This can lead to warnings from the C++ compiler (GCC):

warning: the address of ‘i’ will never be NULL [-Waddress]

clang:

warning: comparison of address of 'i' not equal to a null pointer is 
always true [-Wtautological-pointer-compare]

It can be fixed by using for GCC:

(uintp_t) CONFIGURE_TASK_STACK_ALLOCATOR != 0

However, clang doesn't like this:

error: static_assert expression is not an integral constant expression
static_assert((long)&i != 0, "x");

-- 
embedded brains GmbH
Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at embedded-brains.de
Phone: +49-89-18 94 741 - 16
Fax:   +49-89-18 94 741 - 08
PGP: Public key available on request.

embedded brains GmbH
Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier: https://embedded-brains.de/datenschutzerklaerung/



More information about the devel mailing list