Dominique wrote:

> I noticed that src/job.c has code in between
> #ifdef USE_ARGV.  However, USE_ARGV is
> not defined anywhere. So there is some dead
> code reported as not covered by tests in codecov
> at job.c:876:
> 
> https://codecov.io/gh/vim/vim/src/master/src/job.c#L896
> 
> I see that USE_ARGV used to be defined, but
> that got removed in the following patch:
> 
> ===
> commit 8b5866ded6036f7adece26b6d16962bbd2d47842 (tag: v8.2.1597)
> Author: Bram Moolenaar <[email protected]>
> Date:   Sat Sep 5 15:48:51 2020 +0200
> 
>     patch 8.2.1597: the channel source file is too big
> 
>     Problem:    The channel source file is too big.
>     Solution:   Move job related code to a new source file.
> ===
> 
> Prior to that patch, file src/channel.c used to define
> USE_ARGV as follows:
> 
> #if defined(UNIX)
> # define USE_ARGV
> 
> Either there was a mistake in patch 8.2.1597 or
> we can remove the dead code in between #ifdef USE_ARGV.
> The description of patch 8.2.1597 suggests that it
> was a refactoring that should not have changed the behavior.

Well spotted.  USE_ARGV is defined, but it's further down.  Making the
functions "static" and moving them to before job_start() caused this
problem: Win32 functions are defined on Unix but never used.  It worked
because the checks are only "if !defined(USE_ARGV)".

I'll move defining USE_ARGV to the top.

-- 
There are only two hard things in programming: Cache invalidation,
naming things and off-by-one errors.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202012091216.0B9CGdPZ1898277%40masaka.moolenaar.net.

Raspunde prin e-mail lui