Project

General

Profile

Actions

Bug #11343

closed

random.c: getrandom compile error with clang

Added by Hanmac (Hans Mackowiak) almost 9 years ago. Updated over 8 years ago.

Status:
Closed
Target version:
-
[ruby-core:69931]

Description

random.c:526:8: error: implicit conversion loses integer precision: 'long' to 'int' [-Werror,-Wshorten-64-to-32]
ret = syscall(SYS_getrandom, seed, size, 0);

which does make the build of clang fail

and there is a warning in rb_ary_new too

enum.c:766:11: warning: unused typedef 'static_assert_rb_ary_new_from_args_check' [-Wunused-local-typedef]
values = rb_ary_new3(1, i);

./include/ruby/intern.h:91:21: note: expanded from macro 'rb_ary_new3'
#define rb_ary_new3 rb_ary_new_from_args

./internal.h:649:6: note: expanded from macro 'rb_ary_new_from_args'
STATIC_ASSERT(rb_ary_new_from_args, numberof(args_to_new_ary) == (n)); \

./internal.h:79:48: note: expanded from macro 'STATIC_ASSERT'
# define STATIC_ASSERT(name, expr) typedef int static_assert_##name##_check[1 - 2*!(expr)]

<scratch space>:354:1: note: expanded from here
static_assert_rb_ary_new_from_args_check

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0