C portability gotcha, example

VLD/VMB gwyn at BRL.ARPA
Sun Nov 3 08:57:19 AEST 1985


I asked that answers to the puzzle please NOT be posted
to the mailing list / newsgroup, to avoid flooding it
with zillions of messages (mostly wrong).

There is no problem with passing a double datum as a
parameter to a routine that is declared with smaller
formal parameters.  Just consider what must be
happening for printf() and you will see that any
number of parameters of any size may be passed to a
function.  Therefore, the solution to the puzzle is
not that the double datum "doesn't fit" or "clobbers
something outside the parameters".

I suppose I should post the answer in a few days..



More information about the Comp.lang.c mailing list