<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/123851>123851</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [libc][assert] provide `static_assert` macro pre-`__STDC_VERSION__ == 202311L`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            good first issue,
            libc
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          nickdesaulniers
      </td>
    </tr>
</table>

<pre>
    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 
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxsk0-P2yAQxT8Nvoxi4SFO4oMPu0kjrVS1UrdqjxEGbLMlEMGw23z7ys6fbquVfAHGj_nNe8iU7OCNaVn9yOpdITONIbbeql_aJJmdtyamogv63J6iDREowBYFwy2wFU8kyaqDTMlEYisObzKBhKNUMcAphlerjYbuDJeKciwZf2D84QleciIYLQGNNgHFs_XDpN1l6zSocDxZZ-Ii0rxD1ieQg7Q-ETj3elw42ykmHuHNgA6e4Zpu94EEbXrrLdngIfQf9in9v5fkZBLQaO6bk4bMjsBJP2Q5GEgkvZZRA8ONyjEaT-4Mi0SaiZ2q1gybK91PA2kM2WmQWkMKR0PjhCddmCBHA856kyD0TEz1bMUvn5oWKGwPh8Pz99328OPTt-enr18OB2BiC8hRVNXnS9HMOHf1jgw3vydnzgwbODz_d3Q5bW4FFxnjte3f98D4g_Uwjxf31iuXtWG4vw99MZubGO4vwtd1OZYASgFb8j6GjowaodCt0I1oZGHaai3WNcdGYDG22ItaaaFw3VVCaFTcNJ3eqI1uzHJdY2Fb5FjzCisUS6ywVCuzUY3UssPlhquGLbk5SuvKqa8yxKGwKWXTVig2dVU42RmX5lAjDiFo6G1MBHMRQ2S4ZYgXSJxyH9sZsMtDYkvubKL0V5osufmFzD_UO1Y_Xoda7-6p-yhlt3dgFmzFP7B0x8Tu7uqKFzm6diQ6pSkXuGe4HyyNuStVOF49uFlxiuHFKJo8mpgmP67sry3-CQAA__-X3DsI">