Dominique Pelle wrote:

> I see the following compilation warning when compiling
> Vim-7.3a (2245:1bac28a53fae):
> 
> syntax.c:4506: warning: suggest braces around empty body in an =91else=92 s=
> tatement
> 
> It happens when FEAT_MBYTE is defined & FEAT_CONCEAL is undefined
> which is the case when configuring Vim with:
> 
>   ./configure -with-features=3Dnormal --enable-gui=3Dgtk2
> 
> Code in syntax.c is
> 
>   4492 #ifdef FEAT_MBYTE
>   4493             /* cchar=3D? */
>   4494             if (has_mbyte)
>   4495             {
>   4496 # ifdef FEAT_CONCEAL
>   4497                 *conceal_char =3D mb_ptr2char(arg + 6);
>   4498 # endif
>   4499                 arg += mb_ptr2len(arg + 6) - 1;
>   4500             }
>   4501             else
>   4502 #endif
>   4503 #ifdef FEAT_CONCEAL
>   4504                 *conceal_char = arg[6];
>   4505 #else
> !!4506                 ;
>   4507 #endif
> 
> Depending on whether FEAT_MBYTE and/or FEAT_CONCEAL
> are defined/undefined, code becomes:
> 
> FEAT_MBYTE no -- FEAT_CONCEAL no  --> OK
> ================================
>               ;
> 
> FEAT_MBYTE yes -- FEAT_CONCEAL no  --> Compilation warning!
> =================================
>           /* cchar=? */
>           if (has_mbyte)
>           {
>               arg += mb_ptr2len(arg + 6) - 1;
>           }
>           else
>               ;
> 
> FEAT_MBYTE no -- FEAT_CONCEAL yes --> OK
> =================================
>               *conceal_char = arg[6];
> 
> FEAT_MBYTE yes -- FEAT_CONCEAL yes --> OK
> ==================================
>           /* cchar=? */
>           if (has_mbyte)
>           {
>               *conceal_char = mb_ptr2char(arg + 6);
>               arg += mb_ptr2len(arg + 6) - 1;
>           }
>           else
>               *conceal_char = arg[6];
> 
> 
> Attached patch fixes it.

My nightly "test many feature combinations" run also caught this.  I
think I'll just go with adding { }, as the compiler suggested.

-- 
hundred-and-one symptoms of being an internet addict:
164. You got out to buy software, instead of going out for a beer.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.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

Raspunde prin e-mail lui