1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

tree wide: add IWYU pragma: export where needed

We occasionally have some public `foo.h` header that includes a private
`foo_arch.h` header. Users are expected to include the `foo.h` header
and not the `foo_arch.h`. However, clangd will claim that the `#include`
of `foo.h` is unused if only functions / macros/ types / ... from
`foor_arch.h` is used and nothing from `foo.h`.

This adds the `IWYU pragma: export` comment to the include of
`foo_arch.h` in `foo.h`, so that clangd treats functions / macros /
types provided by `foo_arch.h` as if they were instead provided by
`foo.h`, which fixes the false positives.
This commit is contained in:
Marian Buschsieweke 2024-04-14 14:26:05 +02:00
parent 3cdc4379b7
commit cf6fa4edf0
No known key found for this signature in database
GPG Key ID: 77AA882EC78084E6
7 changed files with 7 additions and 7 deletions

View File

@ -129,7 +129,7 @@
#include "thread_flags.h"
#endif
#include "thread_arch.h"
#include "thread_arch.h" /* IWYU pragma: export */
#ifdef __cplusplus
extern "C" {

View File

@ -91,7 +91,7 @@ MAYBE_INLINE bool irq_is_enabled(void);
MAYBE_INLINE bool irq_is_in(void);
#else
#include "irq_arch.h"
#include "irq_arch.h" /* IWYU pragma: export */
#endif /* IRQ_API_INLINED */
#ifdef __cplusplus

View File

@ -866,7 +866,7 @@ static inline void gpio_ll_switch_dir_input(gpio_port_t port, uword_t inputs)
/* the hardware specific implementation relies on the types such as gpio_port_t
* to be provided */
#include "gpio_ll_arch.h"
#include "gpio_ll_arch.h" /* IWYU pragma: export */
#endif /* PERIPH_GPIO_LL_H */
/** @} */

View File

@ -326,7 +326,7 @@ bool timer_poll_channel(tim_t dev, int channel);
#endif
#if defined(MODULE_PERIPH_TIMER_POLL)
#include "timer_arch.h"
#include "timer_arch.h" /* IWYU pragma: export */
#endif
#ifdef __cplusplus

View File

@ -28,7 +28,7 @@
#include <inttypes.h>
#include <limits.h>
#include "architecture_arch.h"
#include "architecture_arch.h" /* IWYU pragma: export */
#ifdef __cplusplus
extern "C" {

View File

@ -142,7 +142,7 @@
#include "macros/utils.h"
#include "sched.h"
#include "atomic_utils_arch.h"
#include "atomic_utils_arch.h" /* IWYU pragma: export */
#ifdef __cplusplus
extern "C" {

View File

@ -54,7 +54,7 @@
#include "kernel_defines.h"
#if IS_ACTIVE(HAS_FLASH_UTILS_ARCH)
#include "flash_utils_arch.h"
#include "flash_utils_arch.h" /* IWYU pragma: export */
#endif
#ifdef __cplusplus