Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: optimise string conversions in history etc.



On Sun, Apr 20, 2008 at 10:11:48PM +0100, Peter Stephenson wrote:
> +	ret = mbrtowc(&wc, bufptr, charlen, &mbs);
> +	if (ret == 0) {
[...]
> +	}
> +	if (ret >= 0) {

Since ret is a size_t, "ret >= 0" is always true.  I've checked in a fix
for that.

Note that I catch things like this due to having more compiler warnings
enabled (-W):

--- configure.ac	4 May 2008 18:43:01 -0000	1.100
+++ configure.ac	5 May 2008 01:06:21 -0000
@@ -385,13 +385,13 @@ dnl   else use -O
 if test -n "$auto_cflags" && test ."$ansi2knr" != .yes; then
   if test "${enable_zsh_debug}" = yes; then
     if test -n "$GCC"; then
-      CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -ggdb"
+      CFLAGS="$CFLAGS -Wall -W -Wno-unused-parameter -ggdb"
     else
       CFLAGS="$CFLAGS -g"
     fi
   else
     if test -n "$GCC"; then
-      CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -O2"
+      CFLAGS="$CFLAGS -Wall -W -Wno-unused-parameter -O2"
     else
       CFLAGS="$CFLAGS -O"
     fi

If we want to commit a change like that, we'd need to ensure that
-Wno-unused-parameter was accepted by the compiler (since it wasn't
in older gcc versions).

..wayne..



Messages sorted by: Reverse Date, Date, Thread, Author