bug-gnulib
[Top][All Lists]
Advanced

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

Re: Reconciliation of libsnprintfv vs. autogen


From: Bruno Haible
Subject: Re: Reconciliation of libsnprintfv vs. autogen
Date: Sun, 25 Feb 2007 22:39:07 +0100
User-agent: KMail/1.5.4

Bruce Korb wrote:
> @@ -193,7 +197,7 @@ call_argtype_function (struct printf_inf
> 
>    else
>      {
> -      pinfo->spec = *(unsigned char *) pinfo->format;
> +      pinfo->spec = (unsigned)*(pinfo->format);
>        pinfo->extra = spec->user;
>        pinfo->type = spec->type;

The cast is a no-op anyway. Since pinfo->format is of type 'const char *'
and pinfo->spec is of type 'char', both variants are equivalent to

         pinfo->spec = * pinfo->format;

You need to case a 'char' to 'unsigned char' only
  - when using them as array indices,
  - when passing them to <ctype.h> functions,
  - when comparing them to values obtained through getc() or fgetc().

Bruno





reply via email to

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