Skip to content

Not building on Ruby 3.0.7: incompatible pointer type [-Wincompatible-pointer-types] #801

@soundasleep

Description

@soundasleep

It appears Redcarpet is no longer building on GitHub Actions with the latest ruby/setup-ruby@v1 on Windows, I'm not sure what's changed:

> gem install sass activesupport chunky_png md_to_bbcode nokogiri
Run gem install sass activesupport chunky_png md_to_bbcode nokogiri
ERROR:  Error installing md_to_bbcode:
	ERROR: Failed to build gem native extension.

[ ... ]

compiling rc_markdown.c
rc_markdown.c: In function 'Init_redcarpet':
rc_markdown.c:190:57: error: passing argument 3 of 'rb_define_singleton_method' from incompatible pointer type [-Wincompatible-pointer-types]
  190 |         rb_define_singleton_method(rb_cMarkdown, "new", rb_redcarpet_md__new, -1);
      |                                                         ^~~~~~~~~~~~~~~~~~~~
      |                                                         |
      |                                                         VALUE (*)(int,  VALUE *, VALUE) {aka long long unsigned int (*)(int,  long long unsigned int *, long long unsigned int)}
In file included from C:/hostedtoolcache/windows/Ruby/3.0.7/x64/include/ruby-3.0.0/ruby/internal/anyargs.h:76,
                 from C:/hostedtoolcache/windows/Ruby/3.0.7/x64/include/ruby-3.0.0/ruby/ruby.h:24,
                 from C:/hostedtoolcache/windows/Ruby/3.0.7/x64/include/ruby-3.0.0/ruby.h:38,
                 from redcarpet.h:27,
                 from rc_markdown.c:23:
C:/hostedtoolcache/windows/Ruby/3.0.7/x64/include/ruby-3.0.0/ruby/internal/intern/class.h:52:53: note: expected 'VALUE (*)(void)' {aka 'long long unsigned int (*)(void)'} but argument is of type 'VALUE (*)(int,  VALUE *, VALUE)' {aka 'long long unsigned int (*)(int,  long long unsigned int *, long long unsigned int)'}
   52 | void rb_define_singleton_method(VALUE, const char*, VALUE(*)(ANYARGS), int);
      |                                                     ^~~~~~~~~~~~~~~~~
rc_markdown.c:99:14: note: 'rb_redcarpet_md__new' declared here
   99 | static VALUE rb_redcarpet_md__new(int argc, VALUE *argv, VALUE klass)
      |              ^~~~~~~~~~~~~~~~~~~~
rc_markdown.c:191:50: error: passing argument 3 of 'rb_define_method' from incompatible pointer type [-Wincompatible-pointer-types]
  191 |         rb_define_method(rb_cMarkdown, "render", rb_redcarpet_md_render, 1);
      |                                                  ^~~~~~~~~~~~~~~~~~~~~~
      |                                                  |
      |                                                  VALUE (*)(VALUE,  VALUE) {aka long long unsigned int (*)(long long unsigned int,  long long unsigned int)}
In file included from C:/hostedtoolcache/windows/Ruby/3.0.7/x64/include/ruby-3.0.0/ruby/internal/anyargs.h:78:
C:/hostedtoolcache/windows/Ruby/3.0.7/x64/include/ruby-3.0.0/ruby/internal/method.h:29:41: note: expected 'VALUE (*)(void)' {aka 'long long unsigned int (*)(void)'} but argument is of type 'VALUE (*)(VALUE,  VALUE)' {aka 'long long unsigned int (*)(long long unsigned int,  long long unsigned int)'}
   29 | void rb_define_method(VALUE,const char*,VALUE(*)(ANYARGS),int);
      |                                         ^~~~~~~~~~~~~~~~~
rc_markdown.c:143:14: note: 'rb_redcarpet_md_render' declared here
  143 | static VALUE rb_redcarpet_md_render(VALUE self, VALUE text)
      |              ^~~~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:246: rc_markdown.o] Error 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions