Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: ANSI C prototypes Message-ID: <14602@smoke.brl.mil> Date: 28 Nov 90 18:09:09 GMT References: <1906@necisa.ho.necisa.oz> <75@homer.cs.mcgill.ca> <126872@linus.mitre.org> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 16 In article <126872@linus.mitre.org> jrv@sdimax2.mitre.org (VanZandt) writes: >Is there a convenient way to write such functions without using a cast for >every reference to a or b? Copying their values into local pointers of the >appropriate type seems a kludge. I suppose I could avoid #including stdlib.h, >and declare the arguments to be whatever type I liked. If you don't declare the argument types properly, your code will not be strictly conforming. The only "cheat" that is allowed is to use char* instead of void*, because the standard required these to have the same representation. This is NOT required for other pointer types, just for these two. The three obvious solutions are: explicit cast on each usage of the arguments use a macro to encapsulate the above casting use auto variables of the appropriate type