Skip to content
Commit 32d7b364 authored by Flavio Ceolin's avatar Flavio Ceolin Committed by Carles Cufí
Browse files

toolchain: Add nonnull attribute



Add a new macro for __attribute__((nonnull))). This attribute
allows functions to declare which parameters shouldn't be null.
This helps to catch errors like:

void test(void *a, void *b, void *c) __attribute_nonnull(1, 3);

/zephyrproject/zephyr/samples/hello_world/src/main.c:28:9: warning:
argument 3 null where non-null expected [-Wnonnull]
   28 |         test(a, NULL, NULL);
      |         ^~~~

Signed-off-by: default avatarFlavio Ceolin <flavio.ceolin@intel.com>
parent 7e8243b6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment