Dominique wrote:

> Bram Moolenaar <[email protected]> wrote:
> 
> > Patch 8.2.4093
> > Problem:    Cached breakindent values not initialized properly.
> > Solution:   Initialize and cache formatlistpat. (Christian Brabandt,
> >             closes #9526, closes #9512)
> > Files:      runtime/doc/options.txt, src/indent.c, src/option.c,
> >             src/proto/option.pro, src/testdir/test_breakindent.vim
> 
> ...snip...
> 
> >   /*
> > +  * Get the local or global value of 'formatlistpat'.
> > +  */
> > +     char_u *
> > + get_flp_value(buf_T *buf)
> > + {
> > +     return buf->b_p_flp ? buf->b_p_flp : p_flp;
> > +     if (buf->b_p_flp == NULL || *buf->b_p_flp == NUL)
> > +       return p_flp;
> > +     return buf->b_p_flp;
> > + }
> 
> Code is deadcode after the first return.
> gcc-11 reports:
> 
> option.c:7062:9: warning: code will never be executed [-Wunreachable-code]
>     if (buf->b_p_flp == NULL || *buf->b_p_flp == NUL)
>         ^~~

The first line should not be there, b_p_flp should not be NULL (after
initialization) but can be empty.
This also suggests there is no test for using the global value...

-- 
Overflow on /dev/null, please empty the bit bucket.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            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/20220115110103.EF0941C03C8%40moolenaar.net.

Raspunde prin e-mail lui