Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v8.2.0826 produces incompatible pointer type warnings in if_ruby.c on Ubuntu 20.04 LTS #6145

Open
mgedmin opened this issue May 26, 2020 · 2 comments
Labels

Comments

@mgedmin
Copy link

mgedmin commented May 26, 2020

Describe the bug

Compiling vim v8.2.0826 on Ubuntu 20.04 LTS produces these compilation warnings:

gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include   -g -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1        -o objects/channel.o channel.c
In file included from /usr/include/ruby-2.7.0/ruby/ruby.h:2148,
                 from /usr/include/ruby-2.7.0/ruby.h:33,
                 from if_ruby.c:108:
if_ruby.c: In function ‘ruby_vim_init’:
/usr/include/ruby-2.7.0/ruby/intern.h:1218:137: warning: passing argument 3 of ‘rb_define_singleton_method0’ from incompatible pointer type [-Wincompatible-pointer-types]
 1218 | #define rb_define_singleton_method(klass, mid, func, arity) rb_define_singleton_method_choose_prototypem3((arity),(func))((klass),(mid),(func),(arity));
      |                                                                                                                                         ^~~~~~
      |                                                                                                                                         |
      |                                                                                                                                         VALUE (*)(void) {aka long unsigned int (*)(void)}
if_ruby.c:1760:5: note: in expansion of macro ‘rb_define_singleton_method’
 1760 |     rb_define_singleton_method(cBuffer, "current", buffer_s_current, 0);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ruby-2.7.0/ruby/intern.h:1195:27: note: expected ‘VALUE (*)(VALUE)’ {aka ‘long unsigned int (*)(long unsigned int)’} but argument is of type ‘VALUE (*)(void)’ {aka ‘long unsigned int (*)(void)’}
 1195 | RB_METHOD_DEFINITION_DECL(rb_define_singleton_method, (2,3), (VALUE klass, const char *name), (klass, name))
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ruby-2.7.0/ruby/intern.h:1042:82: note: in definition of macro ‘RB_METHOD_DEFINITION_DECL_C’
 1042 |     __attribute__((__unused__,__weakref__(#def),__nonnull__ nonnull))static void defname(RB_UNWRAP_MACRO decl,VALUE(*func)funcargs,int arity);
      |                                                                                  ^~~~~~~
/usr/include/ruby-2.7.0/ruby/intern.h:1074:1: note: in expansion of macro ‘RB_METHOD_DEFINITION_DECL_1’
 1074 | RB_METHOD_DEFINITION_DECL_1(def,nonnull,def##0 ,0 ,decl,vars,(VALUE)) \
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ruby-2.7.0/ruby/intern.h:1195:1: note: in expansion of macro ‘RB_METHOD_DEFINITION_DECL’
 1195 | RB_METHOD_DEFINITION_DECL(rb_define_singleton_method, (2,3), (VALUE klass, const char *name), (klass, name))
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ruby-2.7.0/ruby/intern.h:1218:137: warning: passing argument 3 of ‘rb_define_singleton_method0’ from incompatible pointer type [-Wincompatible-pointer-types]
 1218 | #define rb_define_singleton_method(klass, mid, func, arity) rb_define_singleton_method_choose_prototypem3((arity),(func))((klass),(mid),(func),(arity));
      |                                                                                                                                         ^~~~~~
      |                                                                                                                                         |
      |                                                                                                                                         VALUE (*)(void) {aka long unsigned int (*)(void)}
if_ruby.c:1761:5: note: in expansion of macro ‘rb_define_singleton_method’
 1761 |     rb_define_singleton_method(cBuffer, "count", buffer_s_count, 0);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ruby-2.7.0/ruby/intern.h:1195:27: note: expected ‘VALUE (*)(VALUE)’ {aka ‘long unsigned int (*)(long unsigned int)’} but argument is of type ‘VALUE (*)(void)’ {aka ‘long unsigned int (*)(void)’}
 1195 | RB_METHOD_DEFINITION_DECL(rb_define_singleton_method, (2,3), (VALUE klass, const char *name), (klass, name))
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ruby-2.7.0/ruby/intern.h:1042:82: note: in definition of macro ‘RB_METHOD_DEFINITION_DECL_C’
 1042 |     __attribute__((__unused__,__weakref__(#def),__nonnull__ nonnull))static void defname(RB_UNWRAP_MACRO decl,VALUE(*func)funcargs,int arity);
      |                                                                                  ^~~~~~~
/usr/include/ruby-2.7.0/ruby/intern.h:1074:1: note: in expansion of macro ‘RB_METHOD_DEFINITION_DECL_1’
 1074 | RB_METHOD_DEFINITION_DECL_1(def,nonnull,def##0 ,0 ,decl,vars,(VALUE)) \
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ruby-2.7.0/ruby/intern.h:1195:1: note: in expansion of macro ‘RB_METHOD_DEFINITION_DECL’
 1195 | RB_METHOD_DEFINITION_DECL(rb_define_singleton_method, (2,3), (VALUE klass, const char *name), (klass, name))
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/ruby-2.7.0/ruby.h:33,
                 from if_ruby.c:108:
/usr/include/ruby-2.7.0/ruby/ruby.h:2799:117: warning: passing argument 3 of ‘rb_define_method0’ from incompatible pointer type [-Wincompatible-pointer-types]
 2799 | #define rb_define_method(klass, mid, func, arity) rb_define_method_choose_prototypem3((arity),(func))((klass),(mid),(func),(arity));
      |                                                                                                                     ^~~~~~
      |                                                                                                                     |
      |                                                                                                                     VALUE (*)(void) {aka long unsigned int (*)(void)}
if_ruby.c:1774:5: note: in expansion of macro ‘rb_define_method’
 1774 |     rb_define_method(cBuffer, "line_number", current_line_number, 0);
      |     ^~~~~~~~~~~~~~~~
In file included from /usr/include/ruby-2.7.0/ruby/ruby.h:2148,
                 from /usr/include/ruby-2.7.0/ruby.h:33,
                 from if_ruby.c:108:
/usr/include/ruby-2.7.0/ruby/ruby.h:2775:27: note: expected ‘VALUE (*)(VALUE)’ {aka ‘long unsigned int (*)(long unsigned int)’} but argument is of type ‘VALUE (*)(void)’ {aka ‘long unsigned int (*)(void)’}
 2775 | RB_METHOD_DEFINITION_DECL(rb_define_method, (2,3), (VALUE klass, const char *name), (klass, name))
      |                           ^~~~~~~~~~~~~~~~
/usr/include/ruby-2.7.0/ruby/intern.h:1042:82: note: in definition of macro ‘RB_METHOD_DEFINITION_DECL_C’
 1042 |     __attribute__((__unused__,__weakref__(#def),__nonnull__ nonnull))static void defname(RB_UNWRAP_MACRO decl,VALUE(*func)funcargs,int arity);
      |                                                                                  ^~~~~~~
/usr/include/ruby-2.7.0/ruby/intern.h:1074:1: note: in expansion of macro ‘RB_METHOD_DEFINITION_DECL_1’
 1074 | RB_METHOD_DEFINITION_DECL_1(def,nonnull,def##0 ,0 ,decl,vars,(VALUE)) \
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ruby-2.7.0/ruby/ruby.h:2775:1: note: in expansion of macro ‘RB_METHOD_DEFINITION_DECL’
 2775 | RB_METHOD_DEFINITION_DECL(rb_define_method, (2,3), (VALUE klass, const char *name), (klass, name))
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/ruby-2.7.0/ruby.h:33,
                 from if_ruby.c:108:
/usr/include/ruby-2.7.0/ruby/ruby.h:2799:117: warning: passing argument 3 of ‘rb_define_method0’ from incompatible pointer type [-Wincompatible-pointer-types]
 2799 | #define rb_define_method(klass, mid, func, arity) rb_define_method_choose_prototypem3((arity),(func))((klass),(mid),(func),(arity));
      |                                                                                                                     ^~~~~~
      |                                                                                                                     |
      |                                                                                                                     VALUE (*)(void) {aka long unsigned int (*)(void)}
if_ruby.c:1775:5: note: in expansion of macro ‘rb_define_method’
 1775 |     rb_define_method(cBuffer, "line", line_s_current, 0);
      |     ^~~~~~~~~~~~~~~~
In file included from /usr/include/ruby-2.7.0/ruby/ruby.h:2148,
                 from /usr/include/ruby-2.7.0/ruby.h:33,
                 from if_ruby.c:108:
/usr/include/ruby-2.7.0/ruby/ruby.h:2775:27: note: expected ‘VALUE (*)(VALUE)’ {aka ‘long unsigned int (*)(long unsigned int)’} but argument is of type ‘VALUE (*)(void)’ {aka ‘long unsigned int (*)(void)’}
 2775 | RB_METHOD_DEFINITION_DECL(rb_define_method, (2,3), (VALUE klass, const char *name), (klass, name))
      |                           ^~~~~~~~~~~~~~~~
/usr/include/ruby-2.7.0/ruby/intern.h:1042:82: note: in definition of macro ‘RB_METHOD_DEFINITION_DECL_C’
 1042 |     __attribute__((__unused__,__weakref__(#def),__nonnull__ nonnull))static void defname(RB_UNWRAP_MACRO decl,VALUE(*func)funcargs,int arity);
      |                                                                                  ^~~~~~~
/usr/include/ruby-2.7.0/ruby/intern.h:1074:1: note: in expansion of macro ‘RB_METHOD_DEFINITION_DECL_1’
 1074 | RB_METHOD_DEFINITION_DECL_1(def,nonnull,def##0 ,0 ,decl,vars,(VALUE)) \
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ruby-2.7.0/ruby/ruby.h:2775:1: note: in expansion of macro ‘RB_METHOD_DEFINITION_DECL’
 2775 | RB_METHOD_DEFINITION_DECL(rb_define_method, (2,3), (VALUE klass, const char *name), (klass, name))
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ruby-2.7.0/ruby/intern.h:1218:137: warning: passing argument 3 of ‘rb_define_singleton_method0’ from incompatible pointer type [-Wincompatible-pointer-types]
 1218 | #define rb_define_singleton_method(klass, mid, func, arity) rb_define_singleton_method_choose_prototypem3((arity),(func))((klass),(mid),(func),(arity));
      |                                                                                                                                         ^~~~~~
      |                                                                                                                                         |
      |                                                                                                                                         VALUE (*)(void) {aka long unsigned int (*)(void)}
if_ruby.c:1780:5: note: in expansion of macro ‘rb_define_singleton_method’
 1780 |     rb_define_singleton_method(cVimWindow, "current", window_s_current, 0);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ruby-2.7.0/ruby/intern.h:1195:27: note: expected ‘VALUE (*)(VALUE)’ {aka ‘long unsigned int (*)(long unsigned int)’} but argument is of type ‘VALUE (*)(void)’ {aka ‘long unsigned int (*)(void)’}
 1195 | RB_METHOD_DEFINITION_DECL(rb_define_singleton_method, (2,3), (VALUE klass, const char *name), (klass, name))
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ruby-2.7.0/ruby/intern.h:1042:82: note: in definition of macro ‘RB_METHOD_DEFINITION_DECL_C’
 1042 |     __attribute__((__unused__,__weakref__(#def),__nonnull__ nonnull))static void defname(RB_UNWRAP_MACRO decl,VALUE(*func)funcargs,int arity);
      |                                                                                  ^~~~~~~
/usr/include/ruby-2.7.0/ruby/intern.h:1074:1: note: in expansion of macro ‘RB_METHOD_DEFINITION_DECL_1’
 1074 | RB_METHOD_DEFINITION_DECL_1(def,nonnull,def##0 ,0 ,decl,vars,(VALUE)) \
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ruby-2.7.0/ruby/intern.h:1195:1: note: in expansion of macro ‘RB_METHOD_DEFINITION_DECL’
 1195 | RB_METHOD_DEFINITION_DECL(rb_define_singleton_method, (2,3), (VALUE klass, const char *name), (klass, name))
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ruby-2.7.0/ruby/intern.h:1218:137: warning: passing argument 3 of ‘rb_define_singleton_method0’ from incompatible pointer type [-Wincompatible-pointer-types]
 1218 | #define rb_define_singleton_method(klass, mid, func, arity) rb_define_singleton_method_choose_prototypem3((arity),(func))((klass),(mid),(func),(arity));
      |                                                                                                                                         ^~~~~~
      |                                                                                                                                         |
      |                                                                                                                                         VALUE (*)(void) {aka long unsigned int (*)(void)}
if_ruby.c:1781:5: note: in expansion of macro ‘rb_define_singleton_method’
 1781 |     rb_define_singleton_method(cVimWindow, "count", window_s_count, 0);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ruby-2.7.0/ruby/intern.h:1195:27: note: expected ‘VALUE (*)(VALUE)’ {aka ‘long unsigned int (*)(long unsigned int)’} but argument is of type ‘VALUE (*)(void)’ {aka ‘long unsigned int (*)(void)’}
 1195 | RB_METHOD_DEFINITION_DECL(rb_define_singleton_method, (2,3), (VALUE klass, const char *name), (klass, name))
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ruby-2.7.0/ruby/intern.h:1042:82: note: in definition of macro ‘RB_METHOD_DEFINITION_DECL_C’
 1042 |     __attribute__((__unused__,__weakref__(#def),__nonnull__ nonnull))static void defname(RB_UNWRAP_MACRO decl,VALUE(*func)funcargs,int arity);
      |                                                                                  ^~~~~~~
/usr/include/ruby-2.7.0/ruby/intern.h:1074:1: note: in expansion of macro ‘RB_METHOD_DEFINITION_DECL_1’
 1074 | RB_METHOD_DEFINITION_DECL_1(def,nonnull,def##0 ,0 ,decl,vars,(VALUE)) \
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ruby-2.7.0/ruby/intern.h:1195:1: note: in expansion of macro ‘RB_METHOD_DEFINITION_DECL’
 1195 | RB_METHOD_DEFINITION_DECL(rb_define_singleton_method, (2,3), (VALUE klass, const char *name), (klass, name))
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
if_ruby.c:1791:43: warning: passing argument 2 of ‘rb_define_virtual_variable’ from incompatible pointer type [-Wincompatible-pointer-types]
 1791 |     rb_define_virtual_variable("$curbuf", buffer_s_current, 0);
      |                                           ^~~~~~~~~~~~~~~~
      |                                           |
      |                                           VALUE (*)(void) {aka long unsigned int (*)(void)}
In file included from /usr/include/ruby-2.7.0/ruby.h:33,
                 from if_ruby.c:108:
/usr/include/ruby-2.7.0/ruby/ruby.h:1801:45: note: expected ‘VALUE (*)(ID,  VALUE *)’ {aka ‘long unsigned int (*)(long unsigned int,  long unsigned int *)’} but argument is of type ‘VALUE (*)(void)’ {aka ‘long unsigned int (*)(void)’}
 1801 | void rb_define_virtual_variable(const char*,rb_gvar_getter_t*,rb_gvar_setter_t*);
      |                                             ^~~~~~~~~~~~~~~~~
if_ruby.c:1792:43: warning: passing argument 2 of ‘rb_define_virtual_variable’ from incompatible pointer type [-Wincompatible-pointer-types]
 1792 |     rb_define_virtual_variable("$curwin", window_s_current, 0);
      |                                           ^~~~~~~~~~~~~~~~
      |                                           |
      |                                           VALUE (*)(void) {aka long unsigned int (*)(void)}
In file included from /usr/include/ruby-2.7.0/ruby.h:33,
                 from if_ruby.c:108:
/usr/include/ruby-2.7.0/ruby/ruby.h:1801:45: note: expected ‘VALUE (*)(ID,  VALUE *)’ {aka ‘long unsigned int (*)(long unsigned int,  long unsigned int *)’} but argument is of type ‘VALUE (*)(void)’ {aka ‘long unsigned int (*)(void)’}
 1801 | void rb_define_virtual_variable(const char*,rb_gvar_getter_t*,rb_gvar_setter_t*);
      |                                             ^~~~~~~~~~~~~~~~~

I thought you might want to know.

@chrisbra
Copy link
Member

chrisbra commented Jun 4, 2020

can you provide a patch?

@mgedmin
Copy link
Author

mgedmin commented Jun 4, 2020

Sadly, no: I'm insufficiently familiar with C and Ruby to figure out what's going on here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants