Skip to content

Commit 5e4f457

Browse files
committed
Fix assume warning
That attribute is C++23, not C23
1 parent 57aea8d commit 5e4f457

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

include/prism/compiler/assume.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
* range analysis so it can prune impossible paths. Use it to communicate an
1111
* invariant the caller guarantees but that the compiler cannot otherwise prove.
1212
*/
13-
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L /* C23 or later */
14-
#define PRISM_ASSUME(expr_) [[assume(expr_)]]
15-
#elif defined(__clang__)
13+
#if defined(__clang__)
1614
#define PRISM_ASSUME(expr_) __builtin_assume(expr_)
1715
#elif defined(_MSC_VER)
1816
#define PRISM_ASSUME(expr_) __assume(expr_)
17+
#elif defined(__GNUC__) && (__GNUC__ >= 13)
18+
#define PRISM_ASSUME(expr_) __attribute__((assume(expr_)))
1919
#elif defined(__GNUC__)
2020
#define PRISM_ASSUME(expr_) ((expr_) ? (void) 0 : __builtin_unreachable())
2121
#else

0 commit comments

Comments
 (0)