Project

General

Profile

Bug #19612

Updated by nobu (Nobuyoshi Nakada) over 2 years ago

Makefile: 
 ```makefile 
 INC_DIRS=$(HOME)/.rvm/rubies/ruby-3.2.0/include/ruby/  
 LIB=$(HOME)/.rvm/rubies/ruby-3.2.0/lib/ 
 # Thanks to Job Vranish (https://spin.atomicobject.com/2016/08/26/makefile-c-projects/) 
 TARGET_EXEC := dotiw 

 BUILD_DIR := ./build 
 SRC_DIRS := . 

 # Find all the C and C++ files we want to compile 
 # Note the single quotes around the * expressions. The shell will incorrectly expand these otherwise, but we want to send the * directly to the find command. 
 SRCS := $(shell find $(SRC_DIRS) -name '*.cpp' -or -name '*.c' -or -name '*.s') 

 # Prepends BUILD_DIR and appends .o to every src file 
 # As an example, ./your_dir/hello.cpp turns into ./build/./your_dir/hello.cpp.o 
 OBJS := $(SRCS:%=$(BUILD_DIR)/%.o) 

 # String substitution (suffix version without %). 
 # As an example, ./build/hello.cpp.o turns into ./build/hello.cpp.d 
 DEPS := $(OBJS:.o=.d) 

 # Add a prefix to INC_DIRS. So moduleA would become -ImoduleA. GCC understands this -I flag 
 INC_FLAGS := $(addprefix -I,$(INC_DIRS)) 

 # The -MMD and -MP flags together generate Makefiles for us! 
 # These files will have .d instead of .o as the output. 
 CPPFLAGS := $(INC_FLAGS) -MMD -MP 

 # The final build step. 
 $(BUILD_DIR)/$(TARGET_EXEC): $(OBJS) 
	 $(CC) $(OBJS) -o $@ $(LDFLAGS) $(LIB) -lruby 

 # Build step for C source 
 $(BUILD_DIR)/%.c.o: %.c 
	 mkdir -p $(dir $@) 
	 $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@ 

 # Build step for C++ source 
 $(BUILD_DIR)/%.cpp.o: %.cpp 
	 mkdir -p $(dir $@) 
	 $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ 


 .PHONY: clean 
	 clean: 
	 rm -r $(BUILD_DIR) 

 # Include the .d makefiles. The - at the front suppresses the errors of missing 
 # Makefiles. Initially, all the .d files will be missing, and we don't want those 
 # errors to show up. 
 -include $(DEPS) 
 ``` ______ END OF Makefile ____ 

 dotiw.c: 
 ```C 
 #include "ruby.h" 

 int main(int argc, char* argv[]) 
 { 
	 int state = 0; 	
	 /* construct the VM */ 
	 ruby_init(); 
	 ruby_script(argv[0]); 
	 ruby_init_loadpath(); 
	 void* node = ruby_options(2, "puts \"hello world!\""); 
	 if (ruby_executable_node(node, &state)) 
	 { 
		 state = ruby_exec_node(node); 
	 } 
	 if (state) 
	 { 
		 /* handle exception, perhaps */ 
	 } 

	 return ruby_cleanup(state); 
 } 
 ``` ______ END OF dotiw.c ____ 

 Finally, a compile log: 
 mkdir -p build/./ 
 cc -I/home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ -MMD -MP    -c dotiw.c -o build/./dotiw.c.o 
 In file included from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/backward/2/bool.h:22, 
                  from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/defines.h:74, 
                  from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/ruby.h:25, 
                  from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby.h:38, 
                  from dotiw.c:1: 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/stdbool.h:43:23: error: two or more data types in declaration specifiers 
    43 | typedef unsigned char _Bool; 
       |                         ^~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/stdbool.h:43:1: warning: useless type name in empty declaration 
    43 | typedef unsigned char _Bool; 
       | ^~~~~~~ 
 In file included from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/defines.h:75: 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/backward/2/long_long.h:67:3: error: #error Hello! Ruby developers believe this message must not happen. 
    67 | # error Hello!    Ruby developers believe this message must not happen. 
       |     ^~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/backward/2/long_long.h:68:3: error: #error If you encounter this message, can you file a bug report? 
    68 | # error If you encounter this message, can you file a bug report? 
       |     ^~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/backward/2/long_long.h:69:3: error: #error Remember to attach a detailed description of your environment. 
    69 | # error Remember to attach a detailed description of your environment. 
       |     ^~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/backward/2/long_long.h:70:3: error: #error Thank you! 
    70 | # error Thank you! 
       |     ^~~~~ 
 In file included from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/defines.h:79: 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/missing.h:64:5: error: unknown type name 'time_t' 
    64 |       time_t tv_sec;        /* seconds */ 
       |       ^~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/missing.h:75:5: error: unknown type name 'time_t' 
    75 |       time_t tv_sec;        /* seconds */ 
       |       ^~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/missing.h:248:13: error: unknown type name 'rb_uid_t' 
   248 | RUBY_EXTERN rb_uid_t geteuid(void); 
       |               ^~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/missing.h:252:13: error: unknown type name 'rb_uid_t' 
   252 | RUBY_EXTERN rb_uid_t getuid(void); 
       |               ^~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/missing.h:256:13: error: unknown type name 'rb_gid_t' 
   256 | RUBY_EXTERN rb_gid_t getegid(void); 
       |               ^~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/missing.h:260:13: error: unknown type name 'rb_gid_t' 
   260 | RUBY_EXTERN rb_gid_t getgid(void); 
       |               ^~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/missing.h:268:13: error: unknown type name 'rb_pid_t' 
   268 | RUBY_EXTERN rb_pid_t getppid(void); 
       |               ^~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/missing.h:272:13: error: unknown type name 'rb_mode_t' 
   272 | RUBY_EXTERN rb_mode_t umask(rb_mode_t); 
       |               ^~~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/missing.h:272:1: warning: parameter names (without types) in function declaration 
   272 | RUBY_EXTERN rb_mode_t umask(rb_mode_t); 
       | ^~~~~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/missing.h:276:37: error: unknown type name 'rb_mode_t' 
   276 | RUBY_EXTERN int chmod(const char *, rb_mode_t); 
       |                                       ^~~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/missing.h:280:37: error: unknown type name 'rb_uid_t' 
   280 | RUBY_EXTERN int chown(const char *, rb_uid_t, rb_gid_t); 
       |                                       ^~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/missing.h:280:47: error: unknown type name 'rb_gid_t' 
   280 | RUBY_EXTERN int chown(const char *, rb_uid_t, rb_gid_t); 
       |                                                 ^~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/missing.h:304:31: error: expected ')' before 'int' 
   304 | RUBY_EXTERN int kill(rb_pid_t, int); 
       |                                 ^~~~ 
       |                                 ) 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/missing.h:337:13: error: unknown type name 'rb_pid_t' 
   337 | RUBY_EXTERN rb_pid_t waitpid(rb_pid_t, int *, int); 
       |               ^~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/missing.h:337:39: error: expected ')' before 'int' 
   337 | RUBY_EXTERN rb_pid_t waitpid(rb_pid_t, int *, int); 
       |                                         ^~~~ 
       |                                         ) 
 In file included from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/value.h:23, 
                  from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/intern/class.h:24, 
                  from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/anyargs.h:76, 
                  from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/ruby.h:27: 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/value.h:128:34: error: 'SIZEOF_INT' undeclared here (not in a function); did you mean 'SIZE_MIN'? 
   128 | RBIMPL_STATIC_ASSERT(sizeof_int, SIZEOF_INT == sizeof(int)); 
       |                                    ^~~~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/static_assert.h:70:27: note: in definition of macro 'RBIMPL_STATIC_ASSERT' 
    70 |       RBIMPL_STATIC_ASSERT0(expr, # name ": " # expr) 
       |                             ^~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/value.h:128:34: error: expression in static assertion is not an integer 
   128 | RBIMPL_STATIC_ASSERT(sizeof_int, SIZEOF_INT == sizeof(int)); 
       |                                    ^~~~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/static_assert.h:70:27: note: in definition of macro 'RBIMPL_STATIC_ASSERT' 
    70 |       RBIMPL_STATIC_ASSERT0(expr, # name ": " # expr) 
       |                             ^~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/value.h:129:35: error: 'SIZEOF_LONG' undeclared here (not in a function) 
   129 | RBIMPL_STATIC_ASSERT(sizeof_long, SIZEOF_LONG == sizeof(long)); 
       |                                     ^~~~~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/static_assert.h:70:27: note: in definition of macro 'RBIMPL_STATIC_ASSERT' 
    70 |       RBIMPL_STATIC_ASSERT0(expr, # name ": " # expr) 
       |                             ^~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/value.h:129:35: error: expression in static assertion is not an integer 
   129 | RBIMPL_STATIC_ASSERT(sizeof_long, SIZEOF_LONG == sizeof(long)); 
       |                                     ^~~~~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/static_assert.h:70:27: note: in definition of macro 'RBIMPL_STATIC_ASSERT' 
    70 |       RBIMPL_STATIC_ASSERT0(expr, # name ": " # expr) 
       |                             ^~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/value.h:130:40: error: 'SIZEOF_LONG_LONG' undeclared here (not in a function) 
   130 | RBIMPL_STATIC_ASSERT(sizeof_long_long, SIZEOF_LONG_LONG == sizeof(LONG_LONG)); 
       |                                          ^~~~~~~~~~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/static_assert.h:70:27: note: in definition of macro 'RBIMPL_STATIC_ASSERT' 
    70 |       RBIMPL_STATIC_ASSERT0(expr, # name ": " # expr) 
       |                             ^~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/value.h:130:67: error: 'LONG_LONG' undeclared here (not in a function); did you mean 'LONG_MIN'? 
   130 | RBIMPL_STATIC_ASSERT(sizeof_long_long, SIZEOF_LONG_LONG == sizeof(LONG_LONG)); 
       |                                                                     ^~~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/static_assert.h:70:27: note: in definition of macro 'RBIMPL_STATIC_ASSERT' 
    70 |       RBIMPL_STATIC_ASSERT0(expr, # name ": " # expr) 
       |                             ^~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/value.h:130:40: error: expression in static assertion is not an integer 
   130 | RBIMPL_STATIC_ASSERT(sizeof_long_long, SIZEOF_LONG_LONG == sizeof(LONG_LONG)); 
       |                                          ^~~~~~~~~~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/static_assert.h:70:27: note: in definition of macro 'RBIMPL_STATIC_ASSERT' 
    70 |       RBIMPL_STATIC_ASSERT0(expr, # name ": " # expr) 
       |                             ^~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/value.h:131:36: error: 'SIZEOF_VOIDP' undeclared here (not in a function); did you mean 'SIZEOF_VALUE'? 
   131 | RBIMPL_STATIC_ASSERT(sizeof_voidp, SIZEOF_VOIDP == sizeof(void *)); 
       |                                      ^~~~~~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/static_assert.h:70:27: note: in definition of macro 'RBIMPL_STATIC_ASSERT' 
    70 |       RBIMPL_STATIC_ASSERT0(expr, # name ": " # expr) 
       |                             ^~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/value.h:131:36: error: expression in static assertion is not an integer 
   131 | RBIMPL_STATIC_ASSERT(sizeof_voidp, SIZEOF_VOIDP == sizeof(void *)); 
       |                                      ^~~~~~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/static_assert.h:70:27: note: in definition of macro 'RBIMPL_STATIC_ASSERT' 
    70 |       RBIMPL_STATIC_ASSERT0(expr, # name ": " # expr) 
       |                             ^~~~ 
 In file included from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/arithmetic/int.h:25, 
                  from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/arithmetic/char.h:23, 
                  from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/arithmetic.h:24, 
                  from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/ruby.h:28: 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/arithmetic/intptr_t.h:45:18: error: unknown type name 'intptr_t' 
    45 | VALUE rb_int2big(intptr_t i); 
       |                    ^~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/arithmetic/intptr_t.h:1:1: note: 'intptr_t' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'? 
   +++ |+#include <stdint.h> 
     1 | #ifndef RBIMPL_ARITHMETIC_INTPTR_T_H                   /*-*-C++-*-vi:se ft=cpp:*/ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/arithmetic/intptr_t.h:53:19: error: unknown type name 'intptr_t' 
    53 | VALUE rb_int2inum(intptr_t i); 
       |                     ^~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/arithmetic/intptr_t.h:53:19: note: 'intptr_t' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'? 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/arithmetic/intptr_t.h:63:19: error: unknown type name 'uintptr_t' 
    63 | VALUE rb_uint2big(uintptr_t i); 
       |                     ^~~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/arithmetic/intptr_t.h:63:19: note: 'uintptr_t' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'? 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/arithmetic/intptr_t.h:71:20: error: unknown type name 'uintptr_t' 
    71 | VALUE rb_uint2inum(uintptr_t i); 
       |                      ^~~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/arithmetic/intptr_t.h:71:20: note: 'uintptr_t' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'? 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/special_consts.h: In function 'RB_STATIC_SYM_P': 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/value.h:110:28: error: 'ULONG_MAX' undeclared (first use in this function) 
   110 | # define RBIMPL_VALUE_FULL ULONG_MAX 
       |                              ^~~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/special_consts.h:270:26: note: in expansion of macro 'RBIMPL_VALUE_FULL' 
   270 |       const VALUE mask = ~(RBIMPL_VALUE_FULL << RUBY_SPECIAL_SHIFT); 
       |                            ^~~~~~~~~~~~~~~~~ 
 In file included from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/arithmetic/long.h:42, 
                  from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/arithmetic/int.h:26: 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/special_consts.h:31:1: note: 'ULONG_MAX' is defined in header '<limits.h>'; did you forget to '#include <limits.h>'? 
    30 | #include "ruby/internal/attr/enum_extensibility.h" 
   +++ |+#include <limits.h> 
    31 | #include "ruby/internal/stdbool.h" 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/value.h:110:28: note: each undeclared identifier is reported only once for each function it appears in 
   110 | # define RBIMPL_VALUE_FULL ULONG_MAX 
       |                              ^~~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/special_consts.h:270:26: note: in expansion of macro 'RBIMPL_VALUE_FULL' 
   270 |       const VALUE mask = ~(RBIMPL_VALUE_FULL << RUBY_SPECIAL_SHIFT); 
       |                            ^~~~~~~~~~~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/arithmetic/long.h: In function 'rb_long2num_inline': 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/arithmetic/long.h:313:16: warning: implicit declaration of function 'rb_int2big' []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-function-declaration-Wimplicit-function-declaration]8;;] 
   313 |           return rb_int2big(v); 
       |                  ^~~~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/arithmetic/long.h: In function 'rb_ulong2num_inline': 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/arithmetic/long.h:328:16: warning: implicit declaration of function 'rb_uint2big' []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-function-declaration-Wimplicit-function-declaration]8;;] 
   328 |           return rb_uint2big(v); 
       |                  ^~~~~~~~~~~ 
 In file included from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/arithmetic.h:31: 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/arithmetic/long_long.h: At top level: 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/arithmetic/long_long.h:44:18: error: expected declaration specifiers or '...' before 'LONG_LONG' 
    44 | VALUE rb_ll2inum(LONG_LONG num); 
       |                    ^~~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/arithmetic/long_long.h:52:38: error: expected ';', ',' or ')' before 'num' 
    52 | VALUE rb_ull2inum(unsigned LONG_LONG num); 
       |                                        ^~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/arithmetic/long_long.h:62:1: error: unknown type name 'LONG_LONG'; did you mean 'LONG_MIN'? 
    62 | LONG_LONG rb_num2ll(VALUE num); 
       | ^~~~~~~~~ 
       | LONG_MIN 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/arithmetic/long_long.h:72:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'rb_num2ull' 
    72 | unsigned LONG_LONG rb_num2ull(VALUE num); 
       |                      ^~~~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/arithmetic/long_long.h:82:18: error: expected declaration specifiers or '...' before 'LONG_LONG' 
    82 | rb_ll2num_inline(LONG_LONG n) 
       |                    ^~~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/arithmetic/long_long.h:95:38: error: expected ';', ',' or ')' before 'n' 
    95 | rb_ull2num_inline(unsigned LONG_LONG n) 
       |                                        ^ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/arithmetic/long_long.h:110:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'rb_num2ll_inline' 
   110 | rb_num2ll_inline(VALUE x) 
       | ^~~~~~~~~~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/arithmetic/long_long.h:127:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'rb_num2ull_inline' 
   127 | rb_num2ull_inline(VALUE x) 
       | ^~~~~~~~~~~~~~~~~ 
 In file included from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/defines.h:73: 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/st.h:177:54: error: unknown type name 'uint32_t' 
   177 | CONSTFUNC(st_index_t rb_st_hash_uint32(st_index_t h, uint32_t i)); 
       |                                                        ^~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/backward/2/attributes.h:50:42: note: in definition of macro 'CONSTFUNC' 
    50 | #define CONSTFUNC(x) RBIMPL_ATTR_CONST() x 
       |                                            ^ 
 In file included from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/arithmetic/st_data_t.h:31, 
                  from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/arithmetic.h:37: 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/st.h:1:1: note: 'uint32_t' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'? 
   +++ |+#include <stdint.h> 
     1 | /* This is a public domain general purpose hash table package 
 In file included from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/core.h:30, 
                  from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/ruby.h:29: 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/core/robject.h:143:14: error: unknown type name 'int32_t' 
   143 | static const int32_t ROBJECT_OFFSET_AS_HEAP_IVPTR = offsetof(struct RObject, as.heap.ivptr); 
       |                ^~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/core/robject.h:143:53: warning: implicit declaration of function 'offsetof' []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-function-declaration-Wimplicit-function-declaration]8;;] 
   143 | static const int32_t ROBJECT_OFFSET_AS_HEAP_IVPTR = offsetof(struct RObject, as.heap.ivptr); 
       |                                                       ^~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/core/robject.h:1:1: note: 'offsetof' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'? 
   +++ |+#include <stddef.h> 
     1 | #ifndef RBIMPL_ROBJECT_H                               /*-*-C++-*-vi:se ft=cpp:*/ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/core/robject.h:143:62: error: expected expression before 'struct' 
   143 | static const int32_t ROBJECT_OFFSET_AS_HEAP_IVPTR = offsetof(struct RObject, as.heap.ivptr); 
       |                                                                ^~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/core/robject.h:144:14: error: unknown type name 'int32_t' 
   144 | static const int32_t ROBJECT_OFFSET_AS_HEAP_IV_INDEX_TBL = offsetof(struct RObject, as.heap.iv_index_tbl); 
       |                ^~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/core/robject.h:144:69: error: expected expression before 'struct' 
   144 | static const int32_t ROBJECT_OFFSET_AS_HEAP_IV_INDEX_TBL = offsetof(struct RObject, as.heap.iv_index_tbl); 
       |                                                                       ^~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/core/robject.h:145:14: error: unknown type name 'int32_t' 
   145 | static const int32_t ROBJECT_OFFSET_AS_ARY = offsetof(struct RObject, as.ary); 
       |                ^~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/core/robject.h:145:55: error: expected expression before 'struct' 
   145 | static const int32_t ROBJECT_OFFSET_AS_ARY = offsetof(struct RObject, as.ary); 
       |                                                         ^~~~~~ 
 In file included from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/ruby.h:34: 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/event.h:103:9: error: unknown type name 'uint32_t' 
   103 | typedef uint32_t rb_event_flag_t; 
       |           ^~~~~~~~ 
 In file included from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/ruby.h:42: 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/memory.h: In function 'rb_mul_size_overflow': 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/memory.h:528:31: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'da' 
   528 |       RB_GNUC_EXTENSION DSIZE_T da, db, c2; 
       |                                 ^~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/memory.h:528:31: error: 'da' undeclared (first use in this function); did you mean 'a'? 
   528 |       RB_GNUC_EXTENSION DSIZE_T da, db, c2; 
       |                                 ^~ 
       |                                 a 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/memory.h:528:35: error: 'db' undeclared (first use in this function); did you mean 'b'? 
   528 |       RB_GNUC_EXTENSION DSIZE_T da, db, c2; 
       |                                     ^~ 
       |                                     b 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/memory.h:528:39: error: 'c2' undeclared (first use in this function); did you mean 'c'? 
   528 |       RB_GNUC_EXTENSION DSIZE_T da, db, c2; 
       |                                         ^~ 
       |                                         c 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/memory.h: In function 'ruby_nonempty_memcpy': 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/memory.h:658:16: warning: implicit declaration of function 'memcpy' []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-function-declaration-Wimplicit-function-declaration]8;;] 
   658 |           return memcpy(dest, src, n); 
       |                  ^~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/memory.h:1:1: note: include '<string.h>' or provide a declaration of 'memcpy' 
   +++ |+#include <string.h> 
     1 | #ifndef RBIMPL_MEMORY_H                                /*-*-C++-*-vi:se ft=cpp:*/ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/memory.h:658:16: warning: incompatible implicit declaration of built-in function 'memcpy' []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wbuiltin-declaration-mismatch-Wbuiltin-declaration-mismatch]8;;] 
   658 |           return memcpy(dest, src, n); 
       |                  ^~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/memory.h:658:16: note: include '<string.h>' or provide a declaration of 'memcpy' 
 In file included from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/ruby.h:49: 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/symbol.h: In function 'rb_intern_const': 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/symbol.h:278:18: warning: implicit declaration of function 'strlen' []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-function-declaration-Wimplicit-function-declaration]8;;] 
   278 |       size_t len = strlen(str); 
       |                    ^~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/symbol.h:1:1: note: include '<string.h>' or provide a declaration of 'strlen' 
   +++ |+#include <string.h> 
     1 | #ifndef RBIMPL_SYMBOL_H                                /*-*-C++-*-vi:se ft=cpp:*/ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/symbol.h:278:18: warning: incompatible implicit declaration of built-in function 'strlen' []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wbuiltin-declaration-mismatch-Wbuiltin-declaration-mismatch]8;;] 
   278 |       size_t len = strlen(str); 
       |                    ^~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/symbol.h:278:18: note: include '<string.h>' or provide a declaration of 'strlen' 
 In file included from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/intern.h:38, 
                  from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/ruby.h:193: 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/intern/file.h: At top level: 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/intern/file.h:209:1: error: unknown type name 'rb_off_t'; did you mean 'off_t'? 
   209 | rb_off_t rb_file_size(VALUE file); 
       | ^~~~~~~~ 
       | off_t 
 In file included from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/intern.h:41: 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/intern/io.h:577:54: error: unknown type name 'mode_t' 
   577 | int rb_cloexec_open(const char *pathname, int flags, mode_t mode); 
       |                                                        ^~~~~~ 
 In file included from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/intern.h:48: 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/intern/process.h:40:37: error: unknown type name 'rb_pid_t' 
    40 | void rb_last_status_set(int status, rb_pid_t pid); 
       |                                       ^~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/intern/process.h:190:1: error: unknown type name 'rb_pid_t' 
   190 | rb_pid_t rb_waitpid(rb_pid_t pid, int *status, int flags); 
       | ^~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/intern/process.h:190:21: error: unknown type name 'rb_pid_t' 
   190 | rb_pid_t rb_waitpid(rb_pid_t pid, int *status, int flags); 
       |                       ^~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/intern/process.h:200:17: error: unknown type name 'rb_pid_t' 
   200 | void rb_syswait(rb_pid_t pid); 
       |                   ^~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/intern/process.h:221:1: error: unknown type name 'rb_pid_t' 
   221 | rb_pid_t rb_spawn(int argc, const VALUE *argv); 
       | ^~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/intern/process.h:240:1: error: unknown type name 'rb_pid_t' 
   240 | rb_pid_t rb_spawn_err(int argc, const VALUE *argv, char *errbuf, size_t buflen); 
       | ^~~~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/intern/process.h:269:25: error: unknown type name 'rb_pid_t' 
   269 | VALUE rb_detach_process(rb_pid_t pid); 
       |                           ^~~~~~~~ 
 In file included from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/intern/select.h:41, 
                  from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/intern.h:54: 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/intern/select/posix.h:48:9: error: unknown type name 'fd_set' 
    48 | typedef fd_set rb_fdset_t; 
       |           ^~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/intern/select/posix.h:86:35: error: unknown type name 'fd_set' 
    86 | rb_fd_copy(rb_fdset_t *dst, const fd_set *src, int n) 
       |                                     ^~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/intern/select/posix.h:101:34: error: unknown type name 'fd_set' 
   101 | rb_fd_dup(rb_fdset_t *dst, const fd_set *src) 
       |                                    ^~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/intern/select/posix.h:119:15: error: unknown type name 'fd_set' 
   119 | static inline fd_set * 
       |                 ^~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/intern/select/posix.h: In function 'rb_fd_max': 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/intern/select/posix.h:135:12: error: 'FD_SETSIZE' undeclared (first use in this function) 
   135 |       return FD_SETSIZE; 
       |              ^~~~~~~~~~ 
 In file included from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/assume.h:29, 
                  from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/backward/2/assume.h:24, 
                  from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/defines.h:72: 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/intern/string.h: In function 'rbimpl_strlen': 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/intern/string.h:1351:30: warning: incompatible implicit declaration of built-in function 'strlen' []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wbuiltin-declaration-mismatch-Wbuiltin-declaration-mismatch]8;;] 
  1351 |       return RBIMPL_CAST((long)strlen(str)); 
       |                                ^~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/cast.h:31:29: note: in definition of macro 'RBIMPL_CAST' 
    31 | # define RBIMPL_CAST(expr) (expr) 
       |                               ^~~~ 
 In file included from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/intern.h:57: 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/intern/string.h:1:1: note: include '<string.h>' or provide a declaration of 'strlen' 
   +++ |+#include <string.h> 
     1 | #ifndef RBIMPL_INTERN_STRING_H                         /*-*-C++-*-vi:se ft=cpp:*/ 
 In file included from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/intern.h:60: 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/intern/time.h: At top level: 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/intern/time.h:59:19: error: unknown type name 'time_t' 
    59 | VALUE rb_time_new(time_t sec, long usec); 
       |                     ^~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/intern/time.h:1:1: note: 'time_t' is defined in header '<time.h>'; did you forget to '#include <time.h>'? 
   +++ |+#include <time.h> 
     1 | #ifndef RBIMPL_INTERN_TIME_H                           /*-*-C++-*-vi:se ft=cpp:*/ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/intern/time.h:70:24: error: unknown type name 'time_t' 
    70 | VALUE rb_time_nano_new(time_t sec, long nsec); 
       |                          ^~~~~~ 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/intern/time.h:70:24: note: 'time_t' is defined in header '<time.h>'; did you forget to '#include <time.h>'? 
 dotiw.c: In function 'main': 
 dotiw.c:10:38: warning: passing argument 2 of 'ruby_options' from incompatible pointer type []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wincompatible-pointer-types-Wincompatible-pointer-types]8;;] 
    10 |           void* node = ruby_options(2, "puts \"hello world!\""); 
       |                                        ^~~~~~~~~~~~~~~~~~~~~~~ 
       |                                        | 
       |                                        char * 
 In file included from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/backward.h:11, 
                  from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/core/rhash.h:33, 
                  from /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/core.h:29: 
 /home/user/.rvm/rubies/ruby-3.2.0/include/ruby/ruby/internal/interpreter.h:92:37: note: expected 'char **' but argument is of type 'char *' 
    92 | void* ruby_options(int argc, char** argv); 
       |                                ~~~~~~~^~~~ 
 make: *** [Makefile:35: build/./dotiw.c.o] Error 1 
 _______ end of log ______ 

 I saw "If you encounter this message, can you file a bug report?"" here's my bug report.  

Back