2008/11/29 Bram Moolenaar wrote:

> Tony Mechelynck wrote:
...[snip...]
>> if_perl.xs:463: null argument where non-null required
>>       a line specific to Perl ver. 5.10 (included) to 6.0 (excluded).
>
> I actually think NULL is OK here.  At least, it has always worked.  I
> don't know how to pass something else, one can't simply pass an empty
> environment.


I see this compilation warning as well. In my Perl the header file
/usr/lib/perl/5.10.0/CORE/proto.h on Ubuntu-8.10, I see:


PERL_CALLCONV void      Perl_sys_init(int* argc, char*** argv)
                        __attribute__nonnull__(1)
                        __attribute__nonnull__(2);

PERL_CALLCONV void      Perl_sys_init3(int* argc, char*** argv, char*** env)
                        __attribute__nonnull__(1)
                        __attribute__nonnull__(2)
                        __attribute__nonnull__(3);


The "__attribute__nonnull(3)" explains why we get the warning.

We can probably call the other function Perl_sys_init(...) instead
of Perl_sys_init3(...).  The patch below gets rid of the compilation
warning but I prefer to let the author of the Perl interface (in CC)
verify whether it's correct.

$ cvs diff -c if_perl.xs
Index: if_perl.xs
===================================================================
RCS file: /cvsroot/vim/vim7/src/if_perl.xs,v
retrieving revision 1.14
diff -c -r1.14 if_perl.xs
*** if_perl.xs  1 Sep 2008 15:56:34 -0000       1.14
--- if_perl.xs  2 Dec 2008 19:25:21 -0000
***************
*** 460,466 ****
      static char *argv[] = { "", "-e", "" };

  #if (PERL_REVISION == 5) && (PERL_VERSION >= 10)
!     Perl_sys_init3(&argc, (char***)&argv, NULL);
  #endif
      perl_interp = perl_alloc();
      perl_construct(perl_interp);
--- 460,466 ----
      static char *argv[] = { "", "-e", "" };

  #if (PERL_REVISION == 5) && (PERL_VERSION >= 10)
!     Perl_sys_init(&argc, (char***)&argv);
  #endif
      perl_interp = perl_alloc();
      perl_construct(perl_interp);

-- Dominique

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui