[comp.std.c] Prototype promotion?

pardo@june.cs.washington.edu (David Keppel) (04/14/89)

I declare a sort routine (like qsort(3)) as

	extern void
    sort (
	void *array_to_sort,
	int number_of_items_in_the_array,
	int size_of_items_in_the_array,
	int (*comparison_function) (void *, void*));


Then, I create a comparison function that takes not "void *" but
"void const *".

	int
    cmp_const (
	void const *a,
	void const *b)
    {
	...
    }

My dpANS compiler (gcc) emits a warning:

    a.c: In function main:
    a.c:65: warning: argument passing between incompatible pointer types

Removing the two `const's from the comparison function causes the
compile to go smoothly.

Is this a bug or a feature?  Of gcc or of dpANS?  If this is a
feature, why is it a feature?

aTdHvAaNnKcSe

	;-D on  ( The man from ANSI )  Pardo
-- 
		    pardo@cs.washington.edu
    {rutgers,cornell,ucsd,ubc-cs,tektronix}!uw-beaver!june!pardo