[padb] [padb-devel] Simple Makefile patch

Ethan Mallove ethan.mallove at sun.com
Thu Nov 5 18:23:02 GMT 2009


On Thu, Nov/05/2009 04:53:49PM, Ashley Pittman wrote:
> 
> Ethan,
> 
> I had a thought about this last night, it could be that the scanf
> qualifier %p isn't working, googling around for some docs suggest that %
> p won't work, can you try the attached patch to see if that fixes the
> issue?  Failing that we might have to wait until I can next get my hands
> on a sun machine.
> 
> http://docs.sun.com/app/docs/doc/816-5168/printf-3ucb?a=view

gcc minfo.c -o minfo.x -ldl -Wall -g
minfo.c: In function 'find_sym':
minfo.c:146: warning: format '%lx' expects type 'long unsigned int *', but argument 3 has type 'void **'
minfo.c:148: warning: format '%lx' expects type 'long unsigned int', but argument 3 has type 'void *'
minfo.c: In function '_find_data':
minfo.c:306: warning: format '%lx' expects type 'long unsigned int', but argument 3 has type 'void *'
minfo.c: In function 'fetch_string':
minfo.c:362: warning: format '%lx' expects type 'long unsigned int', but argument 4 has type 'void *'
minfo.c: In function 'show_op':
minfo.c:468: warning: format '%lx' expects type 'long unsigned int', but argument 3 has type 'void *'

-Ethan

> 
> Ashley,
> 
> -- 
> 
> Ashley Pittman, Bath, UK.
> 
> Padb - A parallel job inspection tool for cluster computing
> http://padb.pittman.org.uk

> Index: minfo.c
> ===================================================================
> --- minfo.c	(revision 319)
> +++ minfo.c	(working copy)
> @@ -141,9 +141,9 @@
>      if ( i != 0 )
>  	return NULL;
>      
> -    i = sscanf(ans, "%p",&addr);
> +    i = sscanf(ans, "%lx",&addr);
>      if ( i != 1 ) {
> -	printf("Failed sscanf %d %p\n",i,addr);
> +	printf("Failed sscanf %d %lx\n",i,addr);
>  	return NULL;
>      }
>      
> @@ -301,7 +301,7 @@
>      if ( size == 0 )
>  	return mqs_ok;
>      
> -    sprintf(req,"data %p %d",(void *)addr,size);
> +    sprintf(req,"data 0x%lx %d",(void *)addr,size);
>      
>      i = ask(req,ans);
>      if ( i != 0 )
> @@ -360,7 +360,7 @@
>      char *ans = malloc(size+16);
>      int i;
>      
> -    sprintf(req,"string %d %p",size,(void *)remote);
> +    sprintf(req,"string %d 0x%lx",size,(void *)remote);
>      i = ask(req,ans);
>      if ( i != 0 ) {
>  	free(ans);
> @@ -469,7 +469,7 @@
>      else
>  	printf("msg%d: Tag desired %d\n",msgid, (int)op->desired_tag);
>      printf("msg%d: system_buffer %d\n",msgid,op->system_buffer);
> -    printf("msg%d: Buffer %p\n",msgid,(void *)op->buffer);
> +    printf("msg%d: Buffer 0x%lx\n",msgid,(void *)op->buffer);
>      
>      i = 0;
>      do {





More information about the padb-devel mailing list