Skip to content

Commit bd5e262

Browse files
committed
cext: Use C23 attributes if supported.
1 parent 8bd9b09 commit bd5e262

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/csnip/cext.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@
2222
* This silences possible compiler warnings related to unused
2323
* functions.
2424
*/
25-
#if defined(__GNUC__) || defined(__clang__)
26-
#define csnip_cext_unused __attribute__((__unused__))
25+
#if __STDC_VERSION__ >= 202311L
26+
# define csnip_cext_unused [[maybe_unused]]
27+
#elif defined(__GNUC__) || defined(__clang__)
28+
# define csnip_cext_unused __attribute__((__unused__))
2729
#else
28-
#define csnip_cext_unused
30+
# define csnip_cext_unused
2931
#endif
3032

3133
/** Mark a symbol as belonging to the public API.

0 commit comments

Comments
 (0)