This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add missing iprintf and iscanf family for SPU


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);
}

int
main (int argc, char **argv)
{
        iprintf(22);
}

[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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]