Issue 123851
Summary [libc][assert] provide `static_assert` macro pre-`__STDC_VERSION__ == 202311L`
Labels good first issue, libc
Assignees
Reporter nickdesaulniers
    prior to C23, `static_assert` was a macro provided by assert.h.

I just hit this trying to build compiler-rt builtins against llvm-libc; we don't provide a definition of `static_assert` and compiler-rt uses the compiler default language standard (currently -std=c17).

We should add something along the lines of:
```c
#if __STDC_VERSION__ < 202311L
#define static_assert(x, y) _Static_assert((x), y)
#endif
```
in libc/include/llvm-libc-macros/assert-macros.h.  cc @frobtech 
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to