Project

General

Profile

Actions

Bug #11343

closed

random.c: getrandom compile error with clang

Added by Hanmac (Hans Mackowiak) about 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
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