You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vim fails to build if it is configured for dynamically loaded Ruby plugin and C23 compiler flag is set. Steps to reproduce:
$ CFLAGS="${CFLAGS} -std=c23" CXXFLAGS="${CXXFLAGS} -std=c23" ./configure --enable-gui=no --enable-rubyinterp=dynamic
$ make
Here are build errors - the issue is C23 takes function with () as function with no argument, but Vim Ruby plugin code uses this way to declare functions which have a callback function as argument, but different functions with different number of arguments are used as callbacks in those declared functions.
I have tried to fix the issue by #16512 by using variadic arguments for the callback arguments, but this breaks Vim build with dynamically linked Ruby interpreter, because now the function declarations were different than how they are declared in Ruby header.
Ruby header anyargs.h actually generates every function with different number of arguments, and hides all of them under generic public macro, which is called from programs using Ruby, and the correct function is used based on number of arguments - unfortunately I was not able to mimic this macro processing in Vim.
I have worked it around for now by setting -std=c17 for compilation, until someone can come up with better solution.
(The other thing came up to my mind is to #ifdef those functions with variadic arguments specially for dynamically loaded Ruby plugin - if you would prefer this solution, do let me know, I can prepare PR for it)
Expected behaviour
Vim builds with dynamic Ruby plugin under C23.
Version of Vim
Current master patchlevel - 9.1.1071
Environment
OS: Fedora 41
TERM: xterm-256color
Compiler: gcc-14.2.1-7.fc41.x86_64 (but anything with C23 does the trick)
Ruby: ruby-devel-3.3.6-17.fc41.x86_64
Logs and stack traces
The text was updated successfully, but these errors were encountered:
Steps to reproduce
Vim fails to build if it is configured for dynamically loaded Ruby plugin and C23 compiler flag is set. Steps to reproduce:
Here are build errors - the issue is C23 takes function with
()
as function with no argument, but Vim Ruby plugin code uses this way to declare functions which have a callback function as argument, but different functions with different number of arguments are used as callbacks in those declared functions.I have tried to fix the issue by #16512 by using variadic arguments for the callback arguments, but this breaks Vim build with dynamically linked Ruby interpreter, because now the function declarations were different than how they are declared in Ruby header.
Ruby header
anyargs.h
actually generates every function with different number of arguments, and hides all of them under generic public macro, which is called from programs using Ruby, and the correct function is used based on number of arguments - unfortunately I was not able to mimic this macro processing in Vim.I have worked it around for now by setting
-std=c17
for compilation, until someone can come up with better solution.(The other thing came up to my mind is to #ifdef those functions with variadic arguments specially for dynamically loaded Ruby plugin - if you would prefer this solution, do let me know, I can prepare PR for it)
Expected behaviour
Vim builds with dynamic Ruby plugin under C23.
Version of Vim
Current master patchlevel - 9.1.1071
Environment
OS: Fedora 41
TERM: xterm-256color
Compiler: gcc-14.2.1-7.fc41.x86_64 (but anything with C23 does the trick)
Ruby: ruby-devel-3.3.6-17.fc41.x86_64
Logs and stack traces
The text was updated successfully, but these errors were encountered: