Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!mordor!sri-spam!ames!elroy!cit-vax!andy From: andy@cit-vax.Caltech.Edu (Andy Fyfe) Newsgroups: comp.lang.c Subject: const void * Message-ID: <6214@cit-vax.Caltech.Edu> Date: 21 Apr 88 07:14:49 GMT Reply-To: andy@cit-vax.UUCP (Andy Fyfe) Distribution: na Organization: California Institute of Technology Lines: 27 What does (or should?) the ANSI standard say about const void *? My intuition says that, so far as conversions without an explicit cast go, the following should be legal: any * <--> void * const any * <--> const void * any * --> const void * const any * <-- void * Or, void * is the generic pointer, and const is treated separately as an attribute that can be added but not taken away (without an explicit cast). Is this the way it is supposed to work? If plain "void *" is to be the generic pointer, is K&R 2 correct in defining memcmp as int memcmp(const void *, const void *, size_t) or fwrite as size_t fwrite(const void *, size_t, size_t, FILE *) for example? Also, should "const any * --> void *" be allowed, since "void *" is the generic pointer? -- Andy Fyfe andy@csvax.caltech.edu wjafyfe@caltech.bitnet andy@cit-vax.UUCP (...!ames!elroy!cit-vax!andy)