[Mono-list] [PATCH] kill warnings part 1

Martin Baulig martin@gnome.org
02 Jun 2002 17:19:16 +0200


Dennis Haney <davh@davh.dk> writes:

> Index: jit/debug-dwarf2.c
> ===================================================================
> RCS file: /mono/mono/mono/jit/debug-dwarf2.c,v
> retrieving revision 1.25
> diff -u -b -B -r1.25 debug-dwarf2.c
> --- jit/debug-dwarf2.c	30 May 2002 14:30:13 -0000	1.25
> +++ jit/debug-dwarf2.c	1 Jun 2002 21:52:11 -0000
> @@ -176,7 +176,7 @@
>  static void
>  dwarf2_write_address (FILE *f, void *address)
>  {
> -	fprintf (f, "\t.long 0x%lx\n", address);
> +	fprintf (f, "\t.long 0x%p\n", address);
>  }

This is wrong, feel free to add a cast for the argument, but please don't change
the format.

(even if you correct your mistake and make it read ".long %p", this is still
wrong - "%p" doesn't do what it's supposed to do on MinGW and the MinGW authors
refuse to fix it - and there's still the NULL pointer problem with the "%p" format).

> Index: jit/linear-scan.c
> ===================================================================
> RCS file: /mono/mono/mono/jit/linear-scan.c,v
> retrieving revision 1.4
> diff -u -b -B -r1.4 linear-scan.c
> --- jit/linear-scan.c	10 May 2002 09:10:54 -0000	1.4
> +++ jit/linear-scan.c	1 Jun 2002 21:52:11 -0000
> @@ -32,6 +32,7 @@
>  	return mono_bitset_mem_new (mem, max_size, MONO_BITSET_DONT_FREE);
>  }
>  
> +/* unused
>  static void
>  mono_bitset_print (MonoBitSet *set)
>  {
> @@ -46,6 +47,7 @@
>  	}
>  	printf ("}");
>  }
> +*/

Hmm, IMHO it'd be better to either remove unneeded functions or at least to use
G_GNUC_UNUSED if there's a reason to keep them.

-- 
Martin Baulig
martin@gnome.org