Skip to content

Commit

Permalink
Fix build error with arm gcc 12.3.1
Browse files Browse the repository at this point in the history
While trying to build with arm-none-eabi-gcc version 12.3.1
and setting LIBC: nano, the compiler did not recognise static_assert.
  • Loading branch information
kasjer authored and sjanc committed Sep 15, 2023
1 parent 85b44e1 commit 5f3bf9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion hw/mcu/nordic/include/nrfx_glue.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ extern "C" {
*
* @param expression Expression to evaluate.
*/
#define NRFX_STATIC_ASSERT(expression) static_assert(expression, "")
#define NRFX_STATIC_ASSERT(expression) _Static_assert(expression, "")

//------------------------------------------------------------------------------

Expand Down
2 changes: 2 additions & 0 deletions libc/baselibc/include/assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ extern "C" {

#if !defined __cplusplus
#define static_assert _Static_assert
#elif !defined _Static_assert
#define _Static_assert static_assert
#endif

#ifdef __cplusplus
Expand Down

0 comments on commit 5f3bf9a

Please sign in to comment.