PATCH: silence more warnings from libc/machine/spu

Jeff Johnston jjohnstn@redhat.com
Mon Jan 29 22:54:00 GMT 2007


Ben Elliston wrote:
> This patch removes some more warnings (this gets us very close to
> warning-free on spu-elf).  Okay to commit?
> 

Yes.

> 2007-01-29  Ben Elliston  <bje@au.ibm.com>
> 
> 	* libc/machine/spu/vsnprintf.c (c99_vsnprintf_t): Const-qualify
> 	fmt member.
> 	* libc/machine/spu/printf.c (c99_printf_t): Likewise.
> 	(printf): Pass fmt to va_start to suppress a warning.
> 
> Index: printf.c
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/machine/spu/printf.c,v
> retrieving revision 1.1
> diff -u -r1.1 printf.c
> --- printf.c    18 Dec 2006 20:39:02 -0000      1.1
> +++ printf.c    29 Jan 2007 05:26:37 -0000
> @@ -1,4 +1,3 @@
> -
>  #include <_ansi.h>
>  #include <stdio.h>
>  
> @@ -12,7 +11,7 @@
>  
>  typedef struct
>  {
> -  char* fmt;
> +  _CONST char* fmt;
>    unsigned int pad0[ 3 ];
>    va_list ap;
>  } c99_printf_t;
> @@ -38,13 +37,11 @@
>  
>    args.fmt = fmt;
>  #ifdef _HAVE_STDC
> -  va_start (args.ap, args.fmt);
> +  va_start (args.ap, fmt);
>  #else
>    va_start (args.ap);
>  #endif
>  
> -
> -  /*  ret = vfprintf (_stdout_r (_REENT), fmt, ap);*/
>    send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VPRINTF, &args);
>  
>    va_end (args.ap);
> Index: vsnprintf.c
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/machine/spu/vsnprintf.c,v
> retrieving revision 1.1
> diff -u -r1.1 vsnprintf.c
> --- vsnprintf.c 18 Dec 2006 20:39:02 -0000      1.1
> +++ vsnprintf.c 29 Jan 2007 05:26:37 -0000
> @@ -16,7 +16,7 @@
>    unsigned int pad0[ 3 ];
>    size_t size;
>    unsigned int pad1[ 3 ];
> -  char* fmt;
> +  const char* fmt;
>    unsigned int pad2[ 3 ];
>    va_list ap;
>  } c99_vsnprintf_t;
> 
> 



More information about the Newlib mailing list