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.hu...@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/

_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to