ANSI prototype confusion

Byron Rakitzis byron at astro.Princeton.EDU
Sat Dec 8 01:38:57 AEST 1990


The only ANSI compiler I have is gcc, so forgive me if I turn out
to be complaining about a bug in gcc.

I'm writing my own header file for symbols to be found in libc.
I declared qsort as:

        void qsort(void *, int, int, int (*)(void *, void *));

This is okay, except that gcc then complains if strcmp or any
function not taking (void *, void *) as arguments is passed to qsort.
Is this correct? Could someone please enlighten me? The alternative:

        void qsort(void *, int, int, int (*)());

hurts typechecking, as far as I can tell.

Thanks much.

Byron Rakitzis.



More information about the Comp.lang.c mailing list