Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Function-types: compatability, and typedefs Message-ID: <10912@smoke.BRL.MIL> Date: 2 Sep 89 22:57:08 GMT References: <19361@mimsy.UUCP> <9488@venera.isi.edu> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 17 In article <9488@venera.isi.edu> lmiller@venera.isi.edu.UUCP (Larry Miller) writes: > This is my interpretation also, but GNU, in particular, disallows > this. Since my copy of the draft standard is very old (Nov, 1985), > could someone refer to a specific section in the latest draft? The "same representation" requirements were added approximately a year ago. It is possible that the compiler you're using was based on an older draft proposed standard. > void qsort(void *base, size_t n, size_t width, > int (*f)(const void *, const void *)); > Can be passed a char ** as the first element WITHOUT specifically > casting to void * (as long as the prototype is in scope). Yes, because in the presence of a prototype the arguments are converted to the declared types as though by assignment, and these pointer types happen to be assignment-compatible (section 3.3.16).