Skip to content

Commit b7bd55c

Browse files
committed
suppress -Wold-style-cast warnings
1 parent 17a0e2a commit b7bd55c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

include/ruby/internal/stdckdint.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* @brief C23 shim for <stdckdint.h>
2121
*/
2222
#include "ruby/internal/config.h"
23+
#include "ruby/internal/cast.h"
2324
#include "ruby/internal/has/builtin.h"
2425
#include "ruby/internal/stdbool.h"
2526

@@ -47,9 +48,9 @@
4748
# include <stdckdint.h>
4849

4950
#elif RBIMPL_HAS_BUILTIN(__builtin_add_overflow)
50-
# define ckd_add(x, y, z) ((bool)__builtin_add_overflow((y), (z), (x)))
51-
# define ckd_sub(x, y, z) ((bool)__builtin_sub_overflow((y), (z), (x)))
52-
# define ckd_mul(x, y, z) ((bool)__builtin_mul_overflow((y), (z), (x)))
51+
# define ckd_add(x, y, z) RBIMPL_CAST((bool)__builtin_add_overflow((y), (z), (x)))
52+
# define ckd_sub(x, y, z) RBIMPL_CAST((bool)__builtin_sub_overflow((y), (z), (x)))
53+
# define ckd_mul(x, y, z) RBIMPL_CAST((bool)__builtin_mul_overflow((y), (z), (x)))
5354
# define __STDC_VERSION_STDCKDINT_H__ 202311L
5455

5556
#/* elif defined(__cplusplus) */

0 commit comments

Comments
 (0)