Subject: Re: ignoring return values from functions.
To: None <tech-userlevel@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-userlevel
Date: 09/29/2001 21:24:25
> [O]ne should be able to redeclare a function as void and not have to
> typecast it all over the place but NO, we can't do THAT either,
> because gcc is run to be so damnably pedantic that it will complain
> the prototype is redefined.

gcc is right.  Consider a function that returns something too large to
fit in registers; one common way of returning such things is via a
hidden first argument that's a pointer to the return space.  Call via a
prototype that doesn't have that there, and watch your program go down
in flames because the argument list gets shifted over.

Worse, move it from machine A, where conventions happen to be such that
everything "works", to machine B, which uses different calling (or more
precisely returning) conventions, and watch "working" code break....

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B