Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site brl-vgr.ARPA Path: utzoo!watmath!clyde!floyd!harpo!seismo!brl-vgr!gwyn From: gwyn@brl-vgr.ARPA (Doug Gwyn ) Newsgroups: net.lang.c Subject: Re: Functions with union parameters Message-ID: <3320@brl-vgr.ARPA> Date: Fri, 6-Apr-84 14:03:54 EST Article-I.D.: brl-vgr.3320 Posted: Fri Apr 6 14:03:54 1984 Date-Received: Sat, 7-Apr-84 06:13:30 EST References: <4107@edai.UUCP> Organization: Ballistics Research Lab Lines: 14 I believe "lint" does warn about the non-portable struct/union kludges in your examples. However, if you were to use correct types for the parameters in the first place, it would be perfectly portable (as I believe Guy Harris has pointed out in another response). A useful guideline is: with few exceptions, if one finds he is using coercions (typecasts) heavily, he has chosen inappropriate data types. It is true that some C implementations may have to resort to "thunks" to pass struct/array parameters or function return values. This can be messy; for example, on PDP-11 UNIXes, one cannot use struct-valued functions in the kernel since interrupts wreak havoc with the partially- returned structs. It is also usually much more efficient to pass pointers to structs than the actual structs, as is well known.