[libc-commits] [libc] [libc][RFC] add support for function level attributes (PR #79891)
Schrodinger ZHU Yifan via libc-commits
libc-commits at lists.llvm.org
Wed Jan 31 07:23:46 PST 2024
SchrodingerZhu wrote:
Example:
```c
#if !defined(__LIBC_CONST_ATTR) && defined(__cplusplus) && defined(__GNUC__)
#define __LIBC_CONST_ATTR [[gnu::const]]
#endif
#if !defined(__LIBC_CONST_ATTR) && defined(__GNUC__)
#define __LIBC_CONST_ATTR __attribute__((const))
#endif
#if !defined(__LIBC_CONST_ATTR)
#define __LIBC_CONST_ATTR
#endif
```
https://github.com/llvm/llvm-project/pull/79891
More information about the libc-commits
mailing list