Manuel Ortega wrote:

> On macOS 10.12.3 Sierra, there have suddenly (within the last day, I think)
> appeared compiler warnings during the make phase.  This is Vim 8.0.453.
> See below.
> 
> -Manny
> 
> gcc -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X_UNIX  -g -O2
> -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1        -o objects/screen.o screen.c
> screen.c:4557:33: warning: comparison of constant 256 with expression of
> type
>       'char_u' (aka 'unsigned char') is always true
>       [-Wtautological-constant-out-of-range-compare]
>                                       && VIM_ISBREAK(c) &&
> !VIM_ISBREAK(*ptr))
> 
> ^~~~~~~~~~~~~~~~~
> ./macros.h:176:29: note: expanded from macro 'VIM_ISBREAK'
> #define VIM_ISBREAK(c) ((c) < 256 && breakat_flags[(char_u)(c)])
>                         ~~~ ^ ~~~
> 
> 
> And then later on:
> 
> gcc -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X_UNIX  -g -O2
> -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1        -o objects/json.o json.c
> charset.c:1093:10: warning: comparison of constant 256 with expression of
> type 'char_u' (aka 'unsigned char') is always
>       true [-Wtautological-constant-out-of-range-compare]
>             && !VIM_ISBREAK(s[1])
>                 ^~~~~~~~~~~~~~~~~
> ./macros.h:176:29: note: expanded from macro 'VIM_ISBREAK'
> #define VIM_ISBREAK(c) ((c) < 256 && breakat_flags[(char_u)(c)])
>                         ~~~ ^ ~~~
> charset.c:1123:28: warning: comparison of constant 256 with expression of
> type 'char_u' (aka 'unsigned char') is always
>       true [-Wtautological-constant-out-of-range-compare]
>                             && (col2 == col || !VIM_ISBREAK(*ps))))))
>                                                 ^~~~~~~~~~~~~~~~
> ./macros.h:176:29: note: expanded from macro 'VIM_ISBREAK'
> #define VIM_ISBREAK(c) ((c) < 256 && breakat_flags[(char_u)(c)])
>                         ~~~ ^ ~~~

Hmm, the compiler doesn't understand this is perfectly OK.  Anyway, we
can fix it with a type cast.

The extra check I added is to make sure we don't use the tail byte of a
multi-byte character, like a bug that was recently fixed.

Anyway, there is a long standing todo item for making 'breakat' work for
multi-byte characters.

-- 
hundred-and-one symptoms of being an internet addict:
104. When people ask about the Presidential Election you ask "Which country?"

 /// 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].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui