1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 04:52:59 +01:00

core/xfa: Silence clangd warning

Use `uintptr_t` for arithmetic rather than `const char *` to fix the
following warning:

> comparePointers: Subtracting pointers that point to different objects
This commit is contained in:
Marian Buschsieweke 2022-04-26 22:15:00 +02:00
parent 0a72fc9255
commit a405599986
No known key found for this signature in database
GPG Key ID: CB8E3238CE715A94

View File

@ -25,6 +25,8 @@
#ifndef XFA_H
#define XFA_H
#include <inttypes.h>
/*
* Unfortunately, current gcc trips over accessing XFA's because of their
* zero-size start/end array that are used of symbol markers, with an "array
@ -177,7 +179,7 @@ _Pragma("GCC diagnostic ignored \"-Warray-bounds\"")
* @brief Calculate number of entries in cross-file array
*/
#define XFA_LEN(type, \
name) (((const char *)name ## _end - (const char *)name) / \
name) (((uintptr_t)name ## _end - (uintptr_t)name) / \
sizeof(type))
#ifdef __cplusplus