[PATCH] Add missing iprintf and iscanf family for SPU

Patrick Mansfield patmans@us.ibm.com
Mon Feb 19 03:20:00 GMT 2007

On Fri, Feb 16, 2007 at 11:27:49PM +0900, Kazunori Asayama wrote:
> Here is a patch to add definitions of iprintf() and iscanf() family
> for SPU.
> They are defined as macros which are just replaced with corresponding
> functions of printf() and scanf() family, because, for SPU with
> offloading I/O, we have no benefit by using actually restricted
> versions.
> Please apply the patch.

That fixes the assert problem, but can (or should) we lose the defines for
normal compiles?

And then lose the externs for the unsupplied functions? (Now we just end
up with two externs for some functions.)

I mean this is confusing, and we should not (strictly) prevent a user
defined iprintf when we aren't supplying one:

[elm3a225 misc]$ cat name_collision.c
#include <stdio.h>

int iprintf(int foo)
        fprintf(stderr, "foo is %d\n", foo);

main (int argc, char **argv)

[elm3a225 misc]$ spu-gcc -Wall -mstdmain name_collision.c -o name_collision
name_collision.c:4: error: conflicting types for 'printf'
name_collision.c: In function 'printf':
name_collision.c:6: warning: control reaches end of non-void function
name_collision.c: In function 'main':
name_collision.c:12: warning: control reaches end of non-void function

-- Patrick Mansfield

More information about the Newlib mailing list