Project

General

Profile

Feature #17752 » ruby-trivial-undefind-macros-0002.patch

xtkoba (Tee KOBAYASHI), 04/14/2021 12:59 AM

View differences:

builtin.c
#include "iseq.h"
#include "builtin.h"
#if CROSS_COMPILING
#ifdef CROSS_COMPILING
#define INCLUDED_BY_BUILTIN_C 1
#include "mini_builtin.c"
-- a/eval_intern.h
++ b/eval_intern.h
......
#define EC_REPUSH_TAG() (void)(_ec->tag = &_tag)
#if defined __GNUC__ && __GNUC__ == 4 && (__GNUC_MINOR__ >= 6 && __GNUC_MINOR__ <= 8) || __clang__
#if defined __GNUC__ && __GNUC__ == 4 && (__GNUC_MINOR__ >= 6 && __GNUC_MINOR__ <= 8) || defined __clang__
/* This macro prevents GCC 4.6--4.8 from emitting maybe-uninitialized warnings.
* This macro also prevents Clang from dumping core in EC_EXEC_TAG().
* (I confirmed Clang 4.0.1 and 5.0.0.)
-- a/template/sizes.c.tmpl
++ b/template/sizes.c.tmpl
......
% next
% end
% cond = conditions[type]
#if SIZEOF_<%= type.tr_cpp %> != 0<%= " && #{cond}" if cond %>
#if defined(SIZEOF_<%= type.tr_cpp %>) && SIZEOF_<%= type.tr_cpp %> != 0<%= " && #{cond}" if cond %>
DEFINE(<%= type %>, <%= type.tr_cpp %>);
#endif
% end
-- a/tool/mk_builtin_loader.rb
++ b/tool/mk_builtin_loader.rb
......
f.puts
f.puts " // arity_check"
f.puts "COMPILER_WARNING_PUSH"
f.puts "#if GCC_VERSION_SINCE(5, 1, 0) || __clang__"
f.puts "#if GCC_VERSION_SINCE(5, 1, 0) || defined __clang__"
f.puts "COMPILER_WARNING_ERROR(-Wincompatible-pointer-types)"
f.puts "#endif"
bs.each{|func, (argc, cfunc_name)|
(5-5/5)