bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] dfa: fix signedness warnings


From: Jim Meyering
Subject: Re: [PATCH] dfa: fix signedness warnings
Date: Fri, 21 May 2010 09:40:29 +0200

Paolo Bonzini wrote:
> From: Aharon Robbins <address@hidden>
>
> * src/dfa.c (dfaexec): Cast p when passing it to prepare_wc_buf.
> ---
>  src/dfa.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
>         I got this patch from Arnold Robbins in private mail.
>         Ok to apply?

I tend to avoid accommodating those compiler warnings, precisely
because doing so results in adding casts (and hence an intrinsic
maintainability penalty), but won't object if you add a space
after each ")", per GNU indent.

Not that the rest of grep's code is a model of uniform/compliant
formatting style, but still...

> diff --git a/src/dfa.c b/src/dfa.c
> index 5984a20..14c7087 100644
> --- a/src/dfa.c
> +++ b/src/dfa.c
> @@ -3199,7 +3199,7 @@ dfaexec (struct dfa *d, char const *begin, char *end,
>        MALLOC(mblen_buf, unsigned char, end - begin + 2);
>        MALLOC(inputwcs, wchar_t, end - begin + 2);
>        memset(&mbs, 0, sizeof(mbstate_t));
> -      prepare_wc_buf (p, end);
> +      prepare_wc_buf ((const char *)p, end);
>      }
>  #endif /* MBS_SUPPORT */
>
> @@ -3276,7 +3276,7 @@ dfaexec (struct dfa *d, char const *begin, char *end,
>
>  #if MBS_SUPPORT
>            if (d->mb_cur_max > 1)
> -            prepare_wc_buf (p, end);
> +            prepare_wc_buf ((const char *)p, end);
>  #endif
>          }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]