Skip to content

Conversation

armandomontanez
Copy link
Contributor

If the compiler in use offers __sev(), __wfe(), or __wfi(), forward declare them to be sure they're available for use.

Recent LLVM/Clang changes are enforcing #include <arm_acle.h> as the way to get this builtin:

external/pico-sdk+/src/common/pico_sync/mutex.c:77:9: error: call to undeclared library function '__wfe' with type 'void (void)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
   77 |         lock_internal_spin_unlock_with_wait(&mtx->core, save);
      |         ^
external/pico-sdk+/src/common/pico_sync/include/pico/lock_core.h:128:95: note: expanded from macro 'lock_internal_spin_unlock_with_wait'
  128 | #define lock_internal_spin_unlock_with_wait(lock, save) spin_unlock((lock)->spin_lock, save), __wfe()
      |                                                                                               ^
external/pico-sdk+/src/common/pico_sync/mutex.c:77:9: note: include the header <arm_acle.h> or explicitly provide a declaration for '__wfe'

Forward declaring using the same signature as arm_acle.h makes clang happy again.

If the compiler in use offers __sev(), __wfe(), or __wfi(), forward
declare them to be sure they're available for use.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant