Message-ID: <3EABF6BE.C31A9BA4@yahoo.com> Date: Sun, 27 Apr 2003 11:26:54 -0400 From: CBFalconer Organization: Ched Research X-Mailer: Mozilla 4.75 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: djgpp-workers AT delorie DOT com Subject: Re: Bug 00314 -- div() still broken References: <3e9c6920$0$21928$afc38c87@> <3EA5477F DOT 2020901 AT cyberoptics DOT com> <3ea85d95$0$12489$4c41069e AT reader1 DOT ash DOT ops DOT us DOT uu DOT net> <3ea97d4c$0$19415$4c41069e AT reader1 DOT ash DOT ops DOT us DOT uu DOT net> <3EAB995F DOT 273750D6 AT phekda DOT freeserve DOT co DOT uk> <001701c30ca7$6a9c5d50$0100a8c0 AT acp42g> <3EABBB8A DOT B824DEF5 AT phekda DOT freeserve DOT co DOT uk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Richard Dawe wrote: > ... snip ... > > Returning a struct value isn't an idiom that's used much in C > AFAIK. When I encountered it for the first time with inet_aton > (or whatever it was), I was surprised. I haven't seen much use > of returning a struct between 5 and 8 bytes. What commonly-used > functions do that? div, ldiv, ...? > > So I wouldn't be surprised if no-one (other than Eric & Ben) > has noticed. I originally designed the _sysinfo interface for nmalloc to fit into registers. It grew. WRT div/ldiv, I am morally certain that their original purpose was to avoid two executions of the divide instruction, which implies that they should really be provided as macros that create assembly language. As now implemented they have grown to add the overhead of a call, and are fairly useless unless one operand is volatile. -- Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT worldnet DOT att DOT net) Available for consulting/temporary embedded and systems. USE worldnet address!