зеркало из https://github.com/github/ruby.git
Stop compiling if type mismatch was found.
If there is a type mismatch between expected builtin function type and actual function type, C compiler shows warning. For example, `__builtin_func(1, 2)` expects `func(rb_ec_t*, VALUE self, VALUE p1, VALUE p2)` function definition. However, it is easy to overlook "warning" messages. So this patch changes to stop compiling as an error if there is a mismatch.
This commit is contained in:
Родитель
0ad0a8ff58
Коммит
2eb02dfd3b
|
@ -56,9 +56,15 @@ def mk_builtin_header file
|
|||
|
||||
f.puts
|
||||
f.puts " // arity_check"
|
||||
f.puts "COMPILER_WARNING_PUSH"
|
||||
f.puts "#if GCC_VERSION_SINCE(5, 1, 0) || __clang__"
|
||||
f.puts "COMPILER_WARNING_ERROR(-Wincompatible-pointer-types)"
|
||||
f.puts "#endif"
|
||||
bs.each{|func, argc|
|
||||
f.puts " if (0) rb_builtin_function_check_arity#{argc}(#{func});"
|
||||
}
|
||||
f.puts "COMPILER_WARNING_POP"
|
||||
|
||||
|
||||
path = File.expand_path(file)
|
||||
f.puts
|
||||
|
|
Загрузка…
Ссылка в новой задаче