Changeset fcd9618a in rtems

Timestamp:
12/11/20 12:57:31 (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
2fbc889
Parents:
9edca35d
git-author:
Sebastian Huber <sebastian.huber@…> (12/11/20 12:57:31)
git-committer:
Sebastian Huber <sebastian.huber@…> (12/12/20 10:35:22)
Message:

config: Fix invalid static assertions in C

Expressions in static assertions must be integral constant expressions. In
integral constant expressions the use of address constant expressions is not
allowed.

In static initializers the address constant expressions are allowed. Introduce
a new macro _CONFIGURE_ASSERT_NOT_NULL() which leads to a compile time error if
the second parameter is NULL. It generates error messages like this if for
example

#define CONFIGURE_INIT_TASK_ENTRY_POINT NULL

is provided by the application:

cpukit/include/rtems/confdefs/inittask.h:51:26: error: size of unnamed array is negative

51 | ( _type ) sizeof( int[ ( _value ) != NULL ? 1 : -1 ] ) )

|

cpukit/include/rtems/confdefs/inittask.h:170:3: note: in expansion of macro '_CONFIGURE_ASSERT_NOT_NULL'

170 | _CONFIGURE_ASSERT_NOT_NULL(

| ~

This fix relates to CID 1470570 (PARSE_ERROR).

Update #4181.

(No files)

Note: See TracChangeset for help on using the changeset viewer.